* [patch 2/15] check for dirtying of non-uptodate buffers
@ 2002-05-19 19:36 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2002-05-19 19:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: lkml
- 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);
-
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-05-19 19:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-19 19:36 [patch 2/15] check for dirtying of non-uptodate buffers Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox