All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: linux-afs@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, dhowells@redhat.com,
	akpm@linux-foundation.org,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH] afs: Fix waiting for writeback then skipping folio
Date: Wed,  7 Jun 2023 13:41:20 -0700	[thread overview]
Message-ID: <20230607204120.89416-2-vishal.moola@gmail.com> (raw)
In-Reply-To: <20230607204120.89416-1-vishal.moola@gmail.com>

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.

Fixes: acc8d8588cb7 ("afs: convert afs_writepages_region() to use filemap_get_folios_tag()")
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 fs/afs/write.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/afs/write.c b/fs/afs/write.c
index a724228e4d94..18ccb613dff8 100644
--- 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);
 				}
-- 
2.40.1


  reply	other threads:[~2023-06-07 20:42 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 ` Vishal Moola (Oracle) [this message]
2023-06-09  0:50   ` [PATCH] afs: Fix waiting for writeback then skipping folio Andrew Morton
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=20230607204120.89416-2-vishal.moola@gmail.com \
    --to=vishal.moola@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.