aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/journal.c')
-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));