From: Andrew Morton <akpm@linux-foundation.org>
To: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com
Subject: Re: [PATCH] afs: Fix waiting for writeback then skipping folio
Date: Thu, 8 Jun 2023 17:50:31 -0700 [thread overview]
Message-ID: <20230608175031.9c534e7f554de89e3d972ab2@linux-foundation.org> (raw)
In-Reply-To: <20230607204120.89416-2-vishal.moola@gmail.com>
On Wed, 7 Jun 2023 13:41:20 -0700 "Vishal Moola (Oracle)" <vishal.moola@gmail.com> 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?
> --- a/fs/afs/write.c
> +++ b/fs/afs/write.c
> @@ -731,6 +731,7 @@ static int afs_writepages_region(struct address_space *mapping,
> * (changing page->mapping to NULL), or even swizzled
> * back from swapper_space to tmpfs file mapping
> */
> +try_again:
> if (wbc->sync_mode != WB_SYNC_NONE) {
> ret = folio_lock_killable(folio);
> if (ret < 0) {
> @@ -757,6 +758,7 @@ static int afs_writepages_region(struct address_space *mapping,
> #ifdef CONFIG_AFS_FSCACHE
> folio_wait_fscache(folio);
> #endif
> + goto try_again;
> } else {
> start += folio_size(folio);
> }
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. But
we're also calling afs_write_back_from_locked_folio() with an unlocked
folio, which might cause mayhem.
So I'm suspecting that a cc:stable is needed. David, could you please
take a look and perhaps retest?
Thanks.
next prev parent reply other threads:[~2023-06-09 0:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 20:41 [PATCH] afs: Fix dangling folio ref counts in writeback Vishal Moola (Oracle)
2023-06-07 20:41 ` [PATCH] afs: Fix waiting for writeback then skipping folio Vishal Moola (Oracle)
2023-06-09 0:50 ` Andrew Morton [this message]
2023-06-16 22:43 ` David Howells
2023-06-16 23:22 ` Andrew Morton
2023-06-16 23:26 ` David Howells
2023-06-16 22:30 ` [PATCH] afs: Fix dangling folio ref counts in writeback David Howells
2023-06-16 22:43 ` [PATCH] afs: Fix waiting for writeback then skipping folio David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230608175031.9c534e7f554de89e3d972ab2@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishal.moola@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®