linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Buffer state bits
Date: Thu, 27 Aug 2009 13:14:03 +0200	[thread overview]
Message-ID: <20090827111403.GA14240@duck.novell.com> (raw)
In-Reply-To: <20090826212700.GB691@shareable.org>

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@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2009-08-27 11:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 20:00 Buffer state bits Jan Kara
2009-08-26 21:27 ` Jamie Lokier
2009-08-27 11:14   ` Jan Kara [this message]
2009-08-27 12:33 ` Aneesh Kumar K.V
2009-08-27 14:32   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090827111403.GA14240@duck.novell.com \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=jamie@shareable.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).