public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Qu Wenruo <wqu@suse.com>, Mikhail Zaslonko <zaslonko@linux.ibm.com>
Cc: linux-btrfs@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix the folio leak on S390 hardware acceleration
Date: Wed, 21 Jan 2026 10:28:57 +0100	[thread overview]
Message-ID: <20260121092857.9719A1f-hca@linux.ibm.com> (raw)
In-Reply-To: <1218d786-ad7a-4971-9cd5-273232f62d79@suse.com>

On Wed, Jan 21, 2026 at 09:22:47AM +1030, Qu Wenruo wrote:
> Adding S390 to the mailing list, I got the incorrect address in the initial
> patch.
> 
> Much appreciated if S390 people can give it a test.
> 
> Thanks,
> Qu
> 
> 在 2026/1/19 16:24, Qu Wenruo 写道:
> > [BUG]
> > After commit aa60fe12b4f4 ("btrfs: zlib: refactor S390x HW acceleration
> > buffer preparation"), we no longer release the folio of the page cache
> > of folio returned by btrfs_compress_filemap_get_folio() for S390
> > hardware accerlation path.
> > 
> > [CAUSE]
> > Before that commit, we call kumap_local() and folio_put() after handling
> > each folio.
> > 
> > Although the timing is not ideal (it release previous folio at the
> > beginning of the loop, and rely on some extra cleanup out of the loop),
> > it at least handles the folio release correctly.
> > 
> > Meanwhile the refactored code is easier to read, it lacks the call to
> > release the filemap folio.
> > 
> > [FIX]
> > Add the missing folio_put() for copy_data_into_buffer().
> > 
> > Cc: linux-s390@vger.kernel.orgaa60fe12b4f49f49fc73e5023f8675e2df1f7805
> > Fixes: aa60fe12b4f4 ("btrfs: zlib: refactor S390x HW acceleration buffer preparation")
> > Signed-off-by: Qu Wenruo <wqu@suse.com>
> > ---
> >   fs/btrfs/zlib.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
> > index 6caba8be7c84..10ed48d4a846 100644
> > --- a/fs/btrfs/zlib.c
> > +++ b/fs/btrfs/zlib.c
> > @@ -139,6 +139,7 @@ static int copy_data_into_buffer(struct address_space *mapping,
> >   		data_in = kmap_local_folio(folio, offset);
> >   		memcpy(workspace->buf + cur - filepos, data_in, copy_length);
> >   		kunmap_local(data_in);
> > +		folio_put(folio);
> >   		cur += copy_length;
> >   	}
> >   	return 0;

Mikhail, can you have a look at this, please?

  reply	other threads:[~2026-01-21  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19  5:54 [PATCH] btrfs: fix the folio leak on S390 hardware acceleration Qu Wenruo
2026-01-20 22:17 ` Boris Burkov
2026-01-20 22:52 ` Qu Wenruo
2026-01-21  9:28   ` Heiko Carstens [this message]
2026-02-05 22:54   ` Mikhail Zaslonko
2026-02-06 16:00     ` David Sterba
2026-01-21  4:05 ` David Sterba

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=20260121092857.9719A1f-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=wqu@suse.com \
    --cc=zaslonko@linux.ibm.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