linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Linux Filesystems <linux-fsdevel@vger.kernel.org>,
	Steven Whitehouse <swhiteho@redhat.com>
Subject: Re: Announce: new-aops-1 for 2.6.21-rc3
Date: Mon, 2 Apr 2007 04:14:54 +0200	[thread overview]
Message-ID: <20070402021454.GA5444@wotan.suse.de> (raw)
In-Reply-To: <20070401054218.GA6896@wotan.suse.de>

Hmm, spotted another bug in here too, which also affects mainline AFAIKS.

If the page is already uptodate, then a new buffer will get marked uptodate
but will remain "new"... thus if the read portion of the RMW operation fails,
then the error handler will zero this guy out "to prevent stale data
exposure".

Of course, the data is not stale because it is uptodate, so zeroing out will
cause data loss.

I fixed it thusly, because I think buffer_new should always be cleared
before marking a buffer uptodate. I don't know whether I'll bother submitting
this seperately from the new-aops lineup, but if anyone would like to,
feel free to add my SOB.

--
Index: linux-2.6/fs/buffer.c
===================================================================
--- linux-2.6.orig/fs/buffer.c
+++ linux-2.6/fs/buffer.c
@@ -1813,7 +1813,9 @@ static int __block_prepare_write(struct 
 				unmap_underlying_metadata(bh->b_bdev,
 							bh->b_blocknr);
 				if (PageUptodate(page)) {
+					clear_buffer_new(bh);
 					set_buffer_uptodate(bh);
+					mark_buffer_dirty(bh);
 					continue;
 				}
 				if (block_end > to || block_start < from) {


      reply	other threads:[~2007-04-02  2:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 16:17 Announce: new-aops-1 for 2.6.21-rc3 Nick Piggin
2007-03-15 19:32 ` Joel Becker
2007-03-15 19:57   ` Nick Piggin
2007-03-15 19:53 ` Mark Fasheh
2007-03-15 19:57   ` Nick Piggin
2007-03-15 21:08 ` Mark Fasheh
2007-03-15 23:47 ` Mark Fasheh
2007-03-20  5:36   ` Nick Piggin
2007-04-01  5:42   ` Nick Piggin
2007-04-02  2:14     ` Nick Piggin [this message]

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=20070402021454.GA5444@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=swhiteho@redhat.com \
    /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).