--------------------- PatchSet 831 Date: 2002/05/09 15:59:14 Author: sct Log: Fix the "dump corrupts filesystems" bug. Since block-dev-in-page-cache was added in 2.4.10, and the aliasing between buffered devices and getblk() was restored in 2.4.11, getblk() and friends can be performing IO on a page cache page without the page cache lock being held. The page cache IO assumes that the page cache lock is enough to synchronise things safely, but this breaks if we get aliased IO. In particular, block_read_full_page() assumes that it is safe to begin IO on any non-uptodate bh, regardless of the locked status of the bh. To be safe, we need to test the uptodate state *after* taking the bh lock. Members: fs/buffer.c:1.36.2.20->1.36.2.21 [ext3-1_0-branch] --- linux-ext3-2.4merge/fs/buffer.c.=K0003=.orig Sat Aug 17 20:08:25 2002 +++ linux-ext3-2.4merge/fs/buffer.c Mon Aug 19 18:48:50 2002 @@ -1748,9 +1748,14 @@ } /* Stage 3: start the IO */ - for (i = 0; i < nr; i++) - submit_bh(READ, arr[i]); - + for (i = 0; i < nr; i++) { + struct buffer_head * bh = arr[i]; + if (buffer_uptodate(bh)) + end_buffer_io_async(bh, 1); + else + submit_bh(READ, bh); + } + return 0; }