Re: writepage fs corruption fixes

From: Andrew Morton
Date: Thu Jul 08 2004 - 23:31:49 EST


Andrea Arcangeli <andrea@xxxxxxx> wrote:
>
> 1) The major one (the only one I believe that was triggering [only on
> ext2 due the fact mpage is working only there]) is the marking of the bh
> clean despite we could still run into the "confused" path. After that
> the confused path really becomes confused and it writes nothing and fs
> corruption triggers silenty (the reugular writepage only writes bh that
> are marked dirty, it never attempts to submit_bh anything marked clean).
> The mpage-writepage code must never mark the bh clean as far as it
> wants to still fallback in the regular writepage which depends on the bh
> to be dirty (i.e. the "goto confused" path). This could only triggers
> with memory pressure (it also needs buffer_heads_over_limit == 0, and
> that is frequent under mm pressure).

ooh, nasty, yes. You must be testing the crap out if it.

> 3) Third bug is in the regular writepage, the nr_underway == 0 code was
> walking buffers on an unlocked page without keeping the bh pinned, and
> in turn the bh could be released under it by the VM. Fix is to delay the
> put_bh loop. (this might have triggered but it's not certain)

PG_writeback protects the page from truncate, from invalidate and from page
reclaim. pagevec_strip() won't touch the buffers due to the
PageWriteback() test in try_to_release_page(). So I think we're OK in
there. I can add a couple more coment fixes for this.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/