public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 2/15] check for dirtying of non-uptodate buffers
Date: Sun, 19 May 2002 12:36:16 -0700	[thread overview]
Message-ID: <3CE7FEB0.4507DF32@zip.com.au> (raw)



- Add a debug check to catch people who are marking non-uptodate
  buffers as dirty.

  This is either a source of data corruption, or sloppy programming.

- Fix sloppy programming in ext3 ;)



=====================================

--- 2.5.16/fs/buffer.c~buffer-dirty-check	Sun May 19 11:49:46 2002
+++ 2.5.16-akpm/fs/buffer.c	Sun May 19 12:03:00 2002
@@ -1056,6 +1056,8 @@ __getblk(struct block_device *bdev, sect
  */
 void mark_buffer_dirty(struct buffer_head *bh)
 {
+	if (!buffer_uptodate(bh))
+		buffer_error();
 	if (!test_set_buffer_dirty(bh))
 		__set_page_dirty_nobuffers(bh->b_page);
 }
--- 2.5.16/fs/jbd/recovery.c~buffer-dirty-check	Sun May 19 11:49:46 2002
+++ 2.5.16-akpm/fs/jbd/recovery.c	Sun May 19 11:49:46 2002
@@ -482,9 +482,9 @@ static int do_one_pass(journal_t *journa
 					}
 
 					BUFFER_TRACE(nbh, "marking dirty");
+					set_buffer_uptodate(nbh);
 					mark_buffer_dirty(nbh);
 					BUFFER_TRACE(nbh, "marking uptodate");
-					set_buffer_uptodate(nbh);
 					++info->nr_replays;
 					/* ll_rw_block(WRITE, 1, &nbh); */
 					unlock_buffer(nbh);


-

                 reply	other threads:[~2002-05-19 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3CE7FEB0.4507DF32@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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