linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: Convert test_find_delalloc() to use a folio
Date: Fri, 20 Jun 2025 15:14:56 +0200	[thread overview]
Message-ID: <20250620131456.GW4037@twin.jikos.cz> (raw)
In-Reply-To: <f1cc6120-0410-4c69-b5ec-19194508148a@suse.com>

On Thu, Jun 19, 2025 at 03:11:16PM +0930, Qu Wenruo wrote:
> 
> 
> 在 2025/6/19 12:20, Matthew Wilcox 写道:
> > On Fri, Jun 13, 2025 at 08:07:00PM +0100, Matthew Wilcox (Oracle) wrote:
> >> @@ -201,17 +200,16 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize)
> >>   	 *           |--- search ---|
> >>   	 */
> >>   	test_start = SZ_64M;
> >> -	locked_page = find_lock_page(inode->i_mapping,
> >> +	locked_folio = filemap_lock_folio(inode->i_mapping,
> >>   				     test_start >> PAGE_SHIFT);
> >> -	if (!locked_page) {
> >> -		test_err("couldn't find the locked page");
> >> +	if (!locked_folio) {
> >> +		test_err("couldn't find the locked folio");
> >>   		goto out_bits;
> >>   	}
> >>   	btrfs_set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL);
> >>   	start = test_start;
> >>   	end = start + PAGE_SIZE - 1;
> >> -	found = find_lock_delalloc_range(inode, page_folio(locked_page), &start,
> >> -					 &end);
> >> +	found = find_lock_delalloc_range(inode, locked_folio, &start, &end);
> >>   	if (!found) {
> >>   		test_err("couldn't find delalloc in our range");
> >>   		goto out_bits;
> > 
> > Hm.  How much do you test the failure paths here?  It seems to me that
> > the 'locked_folio' is still locked at this point ...
> 
> Yep, you're right, the error paths here should have the folio unlocked
> (all the error handling after fielmap_lock_folio()).
> 
> It's just very rare to have a commit that won't pass selftest pushed to 
> upstream.
> 
> Mind to fix it in another patch or you wish us to handle it before your 
> series?

Please fix it separately before the series, this needs runtime testing
and is specific to the selftest environment, while the folio conversions
are API-level and straightforward.

  reply	other threads:[~2025-06-20 13:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 19:06 [PATCH 0/3] Folio conversions in extent-io-tests Matthew Wilcox (Oracle)
2025-06-13 19:07 ` [PATCH 1/3] btrfs: Convert test_find_delalloc() to use a folio Matthew Wilcox (Oracle)
2025-06-19  2:50   ` Matthew Wilcox
2025-06-19  5:41     ` Qu Wenruo
2025-06-20 13:14       ` David Sterba [this message]
2025-06-20 13:03     ` David Sterba
2025-06-13 19:07 ` [PATCH 2/3] btrfs: Convert test_find_delalloc() to use a folio, part two Matthew Wilcox (Oracle)
2025-06-13 23:35   ` Qu Wenruo
2025-06-14  0:04     ` Qu Wenruo
2025-06-13 19:07 ` [PATCH 3/3] btrfs: Simplify dump_eb_and_memory_contents() Matthew Wilcox (Oracle)
2025-06-20 13:11 ` [PATCH 0/3] Folio conversions in extent-io-tests 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=20250620131456.GW4037@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).