Re: Buffer state bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 26-08-09 22:27:00, Jamie Lokier wrote:
> Jan Kara wrote:
> > BH_Dirty
> > - Ideally, this bit should mean "buffer has data that have to be
> >   written". But it is not quite true. The problem happens when
> >   someone calls set_page_dirty() on the page to which buffers are
> >   attached or similarly when buffers are attached to a dirty
> >   page. Then all buffers attached to the page are marked dirty -
> >   even those that are beyond end of file which obviously should not
> >   be written.
> > 
> >   When buffer is dirty, the page has to be dirty as well (mark
> >   buffer dirty takes care of that). It is not necessarily the other
> >   way around and buffer dirty bit is what ultimately decides whether
> >   the buffer goes to disk or not.
> 
> That last sentence implies page can be dirty while a buffer in the
> page is not dirty.
  Yes, that happens.

> In that case, do buffers beyond the end of file need to be set dirty
> by set_page_dirty()?  If yes, perhaps the text could explain why.
  No, they need not. But it's racy to check i_size in set_page_dirty
because we don't hold i_mutex... I'll add some explanation to the
paragraph.

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux