> I'm porting my HPFS driver to 2.3.18 and I don't know how to write
> get_block properly. When user does lseek(far beyond file end) and
> write(), get_block must allocate a lot of sectors and clear them (HPFS
> doesn't support holes). The question is: what call should I use to
> clear these sectors?
> 
> Using bread/mark_buffer_dirty/brelse is bad idea - when the block is
> read to page cache later, there are two buffers pointing to the same block
> => data corruption.
> 
> Calling page cache functions to create buffers? get_block is called from
> page cache layer, thus calling anything from there makes possible deadlock
> condition. 
  I think that if you first allocate and fill in references to all needed
blocks without initializing and than you'll initialize data through
block_write_full_page() or block_write_partial_page() than I think you
are not going to have problems with deadlocks. I think that the only lock
held during call of get_block() is lock of the page to be read/written
(but I'm not sure on this issue).
 
                                                Honza

Reply via email to