From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: yangerkun <yangerkun@huawei.com>,
sfrench@samba.org, gregkh@linuxfoundation.org, pc@manguebit.com,
lsahlber@redhat.com, sprasad@microsoft.com, tom@talpey.com,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
stable@kernel.org, nspmangalore@gmail.com, ematsumiya@suse.de,
yangerkun@huaweicloud.com
Subject: Re: [PATCH v3] cifs: fix pagecache leak when do writepages
Date: Thu, 11 Sep 2025 19:17:26 +0100 [thread overview]
Message-ID: <aMMSNnJA6VknuVMB@casper.infradead.org> (raw)
In-Reply-To: <1955609.1757607906@warthog.procyon.org.uk>
On Thu, Sep 11, 2025 at 05:25:06PM +0100, David Howells wrote:
> yangerkun <yangerkun@huawei.com> wrote:
>
> > > if (folio->mapping != mapping ||
> > > !folio_test_dirty(folio)) {
> > > start += folio_size(folio);
> > > + folio_put(folio);
> > > folio_unlock(folio);
> > > goto search_again;
>
> I wonder if the put should be prior to the unlock. It probably doesn't matter
> as we keep control of the folio until both have happened.
Well, folio->mapping != mapping is the condition for 'this folio has
been truncated', so this folio_put() may well be the last one. I'd
put it after the folio_unlock() for safety.
>
next prev parent reply other threads:[~2025-09-11 18:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 3:01 [PATCH v3] cifs: fix pagecache leak when do writepages Yang Erkun
2025-09-11 3:22 ` yangerkun
2025-09-11 10:53 ` Greg KH
2025-09-11 11:09 ` yangerkun
2025-09-11 11:17 ` Greg KH
2025-09-11 11:25 ` yangerkun
2025-09-11 11:40 ` Shyam Prasad N
2025-09-11 15:45 ` Enzo Matsumiya
2025-09-11 16:40 ` Steve French
2025-09-11 17:10 ` Greg KH
2025-09-11 16:31 ` David Howells
2025-09-11 16:38 ` Greg KH
2025-09-11 16:25 ` David Howells
2025-09-11 18:17 ` Matthew Wilcox [this message]
2025-09-12 1:12 ` yangerkun
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=aMMSNnJA6VknuVMB@casper.infradead.org \
--to=willy@infradead.org \
--cc=dhowells@redhat.com \
--cc=ematsumiya@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-cifs@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=nspmangalore@gmail.com \
--cc=pc@manguebit.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=stable@kernel.org \
--cc=tom@talpey.com \
--cc=yangerkun@huawei.com \
--cc=yangerkun@huaweicloud.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