aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r--fs/jbd2/commit.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 7c6f7eea2316..d73a0d808ec1 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -30,15 +30,22 @@
30#include <trace/events/jbd2.h> 30#include <trace/events/jbd2.h>
31 31
32/* 32/*
33 * Default IO end handler for temporary BJ_IO buffer_heads. 33 * IO end handler for temporary buffer_heads handling writes to the journal.
34 */ 34 */
35static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate) 35static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
36{ 36{
37 struct buffer_head *orig_bh = bh->b_private;
38
37 BUFFER_TRACE(bh, ""); 39 BUFFER_TRACE(bh, "");
38 if (uptodate) 40 if (uptodate)
39 set_buffer_uptodate(bh); 41 set_buffer_uptodate(bh);
40 else 42 else
41 clear_buffer_uptodate(bh); 43 clear_buffer_uptodate(bh);
44 if (orig_bh) {
45 clear_bit_unlock(BH_Shadow, &orig_bh->b_state);
46 smp_mb__after_clear_bit();
47 wake_up_bit(&orig_bh->b_state, BH_Shadow);
48 }
42 unlock_buffer(bh); 49 unlock_buffer(bh);
43} 50}
44 51
@@ -832,6 +839,7 @@ start_journal_io:
832 bh = jh2bh(jh); 839 bh = jh2bh(jh);
833 clear_buffer_jwrite(bh); 840 clear_buffer_jwrite(bh);
834 J_ASSERT_BH(bh, buffer_jbddirty(bh)); 841 J_ASSERT_BH(bh, buffer_jbddirty(bh));
842 J_ASSERT_BH(bh, !buffer_shadow(bh));
835 843
836 /* The metadata is now released for reuse, but we need 844 /* The metadata is now released for reuse, but we need
837 to remember it against this transaction so that when 845 to remember it against this transaction so that when
@@ -839,14 +847,6 @@ start_journal_io:
839 required. */ 847 required. */
840 JBUFFER_TRACE(jh, "file as BJ_Forget"); 848 JBUFFER_TRACE(jh, "file as BJ_Forget");
841 jbd2_journal_file_buffer(jh, commit_transaction, BJ_Forget); 849 jbd2_journal_file_buffer(jh, commit_transaction, BJ_Forget);
842 /*
843 * Wake up any transactions which were waiting for this IO to
844 * complete. The barrier must be here so that changes by
845 * jbd2_journal_file_buffer() take effect before wake_up_bit()
846 * does the waitqueue check.
847 */
848 smp_mb();
849 wake_up_bit(&bh->b_state, BH_Unshadow);
850 JBUFFER_TRACE(jh, "brelse shadowed buffer"); 850 JBUFFER_TRACE(jh, "brelse shadowed buffer");
851 __brelse(bh); 851 __brelse(bh);
852 } 852 }