mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jan Kara <jack@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/4] fs: Warn about writing !uptodate buffers
Date: Wed, 18 Mar 2009 23:07:54 +1100	[thread overview]
Message-ID: <200903182307.54737.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <1237311235-13623-5-git-send-email-jack@suse.cz>

On Wednesday 18 March 2009 04:33:55 Jan Kara wrote:
> Make submit_bh() warn about writing !uptodate buffers. Hopefully this
> warns us about writing garbage (although bugs in write EIO handling
> are going to trigger this as well as they already trigger the warning
> in mark_buffer_dirty()).
>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/buffer.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 22c0144..985f617 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2997,6 +2997,8 @@ int submit_bh(int rw, struct buffer_head * bh)
>  	BUG_ON(!buffer_locked(bh));
>  	BUG_ON(!buffer_mapped(bh));
>  	BUG_ON(!bh->b_end_io);
> +	if (rw & WRITE)
> +		WARN_ON_ONCE(!buffer_uptodate(bh));

Yes very nice assertion to have. Arguably I think it should be a BUG_ON
because it is definitely some state corruption at least, and writing
garbage data to disk at worst. But WARN_ON for now is probably best.

I have some patches to fix up some problems with EIO handling in the
VM (and I think solves the the buffer warning too). I have to get them
out and try to get them merged again... at which point this should
probably be turned into a bug.

Acked-by: Nick Piggin <npiggin@suse.de>

  reply	other threads:[~2009-03-18 12:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 17:33 [PATCH 0/4] Fix bugs and possible data corruption if blocksize < pagesize Jan Kara
2009-03-17 17:33 ` [PATCH 1/4] ext3: Fix false EIO errors Jan Kara
2009-03-17 17:33   ` [PATCH 2/4] ext3: Avoid " Jan Kara
2009-03-17 17:33     ` [PATCH 3/4] fs: Avoid data corruption with blocksize < pagesize Jan Kara
2009-03-17 17:33       ` [PATCH 4/4] fs: Warn about writing !uptodate buffers Jan Kara
2009-03-18 12:07         ` Nick Piggin [this message]
2009-03-18 12:00       ` [PATCH 3/4] fs: Avoid data corruption with blocksize < pagesize Nick Piggin
2009-03-18 14:13         ` Jan Kara
2009-03-18 18:57         ` Jan Kara
2009-03-18 18:42       ` Aneesh Kumar K.V
2009-03-18 18:50         ` 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=200903182307.54737.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®