Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Chris Mason and committed by
Linus Torvalds
3d4492f8 e0e851cf

+13 -2
+13 -2
fs/reiserfs/journal.c
··· 846 846 spin_lock(lock); 847 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 857 if (buffer_dirty(bh)) { 850 858 list_del_init(&jh->list); 851 859 list_add(&jh->list, &tmp); ··· 1038 1030 } 1039 1031 1040 1032 if (!list_empty(&jl->j_bh_list)) { 1033 + int ret; 1041 1034 unlock_kernel(); 1042 - write_ordered_buffers(&journal->j_dirty_buffers_lock, 1043 - journal, jl, &jl->j_bh_list); 1035 + ret = write_ordered_buffers(&journal->j_dirty_buffers_lock, 1036 + journal, jl, &jl->j_bh_list); 1037 + if (ret < 0 && retval == 0) 1038 + retval = ret; 1044 1039 lock_kernel(); 1045 1040 } 1046 1041 BUG_ON(!list_empty(&jl->j_bh_list));