lkml.org 
[lkml]   [2004]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] ext3 jbd needs to wait for locked buffers
From
Date
jbd needs to wait for any io to complete on the buffer before
changing the end_io function. Using set_buffer_locked means that
it can change the end_io function while the page is in the middle of
writeback, and the writeback bit on the page will never get cleared.

Since we set the buffer dirty earlier on, if the page was
previously dirty, pdflush or memory pressure might trigger a
writepage call, which will race with jbd's set_buffer_locked.

Index: linux.t/fs/jbd/commit.c
===================================================================
--- linux.t.orig/fs/jbd/commit.c 2004-06-17 21:01:28.000000000 -0400
+++ linux.t/fs/jbd/commit.c 2004-06-17 21:02:16.000000000 -0400
@@ -504,7 +504,7 @@ write_out_data:
start_journal_io:
for (i = 0; i < bufs; i++) {
struct buffer_head *bh = wbuf[i];
- set_buffer_locked(bh);
+ lock_buffer(bh);
clear_buffer_dirty(bh);
set_buffer_uptodate(bh);
bh->b_end_io = journal_end_buffer_io_sync;

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.070 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site