mirror of https://lore.kernel.org/lkml/
 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 dangling folio ref counts in writeback
Date: Wed,  7 Jun 2023 13:41:19 -0700	[thread overview]
Message-ID: <20230607204120.89416-1-vishal.moola@gmail.com> (raw)

Commit acc8d8588cb7 converted afs_writepages_region() to write back a
folio batch. If writeback needs rescheduling, the function exits without
dropping the references to the folios in fbatch. This patch fixes that.

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/afs/write.c b/fs/afs/write.c
index c822d6006033..a724228e4d94 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -764,6 +764,7 @@ static int afs_writepages_region(struct address_space *mapping,
 					if (skips >= 5 || need_resched()) {
 						*_next = start;
 						_leave(" = 0 [%llx]", *_next);
+						folio_batch_release(&fbatch);
 						return 0;
 					}
 					skips++;
-- 
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 Vishal Moola (Oracle) [this message]
2023-06-07 20:41 ` [PATCH] afs: Fix waiting for writeback then skipping folio Vishal Moola (Oracle)
2023-06-09  0:50   ` 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-1-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 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®