[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <702179.1686955382@warthog.procyon.org.uk>
Date: Fri, 16 Jun 2023 23:43:02 +0100
From: David Howells <dhowells@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: dhowells@...hat.com,
"Vishal Moola (Oracle)" <vishal.moola@...il.com>,
linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] afs: Fix waiting for writeback then skipping folio
Andrew Morton <akpm@...ux-foundation.org> wrote:
> > Commit acc8d8588cb7 converted afs_writepages_region() to write back a
> > folio batch. The function waits for writeback to a folio, but then
> > proceeds to the rest of the batch without trying to write that folio
> > again. This patch fixes has it attempt to write the folio again.
> >
> > This has only been compile tested.
>
> This seems fairly serious?
We will try to write the again later, but sync()/fsync() might now have
skipped it.
> From my reading, we'll fail to write out the dirty data. Presumably
> not easily observable, as it will get written out again later on.
As it's a network filesystem, interactions with third parties could cause
apparent corruption. Closing a file will flush it - but if there's a
simultaneous op of some other kind, a bit of a flush or a sync may get missed
and the copy visible to another user be temporarily missing that bit.
> But we're also calling afs_write_back_from_locked_folio() with an unlocked
> folio, which might cause mayhem.
Without this patch, you mean? There's a "continue" statement that should send
us back to the top of the loop before we get as far as
afs_write_back_from_locked_folio() - and then the folio_unlock() there would
go bang.
David
Powered by blists - more mailing lists