diff options
| author | Andrew Morton <akpm@zip.com.au> | 2002-05-19 02:20:46 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2002-05-19 02:20:46 -0700 |
| commit | 6b9f3b418f690318f88fbfd2002bbd7ca344c04a (patch) | |
| tree | 3dfbcd7b45181ac20a902c33f9bc8da844ba4a99 /fs | |
| parent | cd016d8062823ffa46adb7ae329bf0f6cb4e4466 (diff) | |
[PATCH] check for dirtying of non-uptodate buffers
- 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 ;)
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/buffer.c | 2 | ||||
| -rw-r--r-- | fs/jbd/recovery.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index e1ea3dca4687..5dedcd3c9c7c 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1056,6 +1056,8 @@ __getblk(struct block_device *bdev, sector_t block, int size) */ 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); } diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c index d32693a96bea..48af2d532d0d 100644 --- a/fs/jbd/recovery.c +++ b/fs/jbd/recovery.c @@ -482,9 +482,9 @@ static int do_one_pass(journal_t *journal, } 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); |
