aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorChris Mason <mason@suse.com>2006-02-01 06:06:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 11:53:26 -0500
commit3d4492f81dd7b486f1be0616a1ce7f73760f406e (patch)
tree5161d47d236e18bdb5a1cdafc21e2a55d8de4d15 /fs/reiserfs
parente0e851cf30f1a9bd2e2a7624e9810378d6a2b072 (diff)
[PATCH] reiserfs: reiserfs write_ordered_buffers should not oops on dirty non-uptodate bh
write_ordered_buffers should handle dirty non-uptodate buffers without a BUG() Signed-off-by: Chris Mason <mason@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/journal.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 1b2402a9a8e1..47c9f432dea5 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -846,6 +846,14 @@ static int write_ordered_buffers(spinlock_t * lock,
846 spin_lock(lock); 846 spin_lock(lock);
847 goto loop_next; 847 goto loop_next;
848 } 848 }
849 /* in theory, dirty non-uptodate buffers should never get here,
850 * but the upper layer io error paths still have a few quirks.
851 * Handle them here as gracefully as we can
852 */
853 if (!buffer_uptodate(bh) && buffer_dirty(bh)) {
854 clear_buffer_dirty(bh);
855 ret = -EIO;
856 }
849 if (buffer_dirty(bh)) { 857 if (buffer_dirty(bh)) {
850 list_del_init(&jh->list); 858 list_del_init(&jh->list);
851 list_add(&jh->list, &tmp); 859 list_add(&jh->list, &tmp);
@@ -1030,9 +1038,12 @@ static int flush_commit_list(struct super_block *s,
1030 } 1038 }
1031 1039
1032 if (!list_empty(&jl->j_bh_list)) { 1040 if (!list_empty(&jl->j_bh_list)) {
1041 int ret;
1033 unlock_kernel(); 1042 unlock_kernel();
1034 write_ordered_buffers(&journal->j_dirty_buffers_lock, 1043 ret = write_ordered_buffers(&journal->j_dirty_buffers_lock,
1035 journal, jl, &jl->j_bh_list); 1044 journal, jl, &jl->j_bh_list);
1045 if (ret < 0 && retval == 0)
1046 retval = ret;
1036 lock_kernel(); 1047 lock_kernel();
1037 } 1048 }
1038 BUG_ON(!list_empty(&jl->j_bh_list)); 1049 BUG_ON(!list_empty(&jl->j_bh_list));