[patch 2/15] check for dirtying of non-uptodate buffers

Andrew Morton (akpm@zip.com.au)
Sun, 19 May 2002 12:36:16 -0700


- 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);

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/