Messages in this thread | | | Date | Sun, 14 Apr 2002 14:08:37 +0100 | From | "Stephen C. Tweedie" <> | Subject | Re: [RFC] Patch: aliasing bug in blockdev-in-pagecache? |
| |
Hi,
On Sun, Apr 14, 2002 at 08:59:15AM -0400, Alexander Viro wrote:
> On Sat, 13 Apr 2002, Stephen C. Tweedie wrote: > > > To solve this, we really do need to have block_read_full_page() test > > the uptodate state under protection of the buffer_head lock. We > > already go through 3 stages in block_read_full_page(): gather the > > buffers needing IO, then lock them, then submit the IO. To be safe, > > we need a final test for buffer_uptodate() *after* we have locked the > > required buffers. > > Ouch. > > I suspect that correct fix is to do that test in submit_bh() itself > (and remove it from ll_rw_block()). IMO it's cleaner than messing > with all callers out there... Linus?
Actually, if we move the test to submit_bh(), we _do_ need to mess with all callers.
submit_bh() is currently an unconditional demand to perform a given IO regardless of buffer state, so lots of callers (ext3 journal writes, soft raid mirror writes etc) call it with private buffer_heads which just don't have any persistent dirty / uptodate state. Changing submit_bh() still means we need to audit all callers to make sure that they set up those state flags correctly even for private bh'es.
Cheers, Stephen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |