From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Filipe Manana <fdmanana@kernel.org>, Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, AHN SEOK-YOUNG <iamsyahn@gmail.com>,
Teng Liu <27rabbitlt@gmail.com>
Subject: Re: [PATCH v4 2/2] btrfs: warn about extent buffer that can not be released
Date: Fri, 1 May 2026 07:28:49 +0930 [thread overview]
Message-ID: <24c783e3-fb72-41d2-8a82-dcebd768eff0@gmx.com> (raw)
In-Reply-To: <CAL3q7H60GiqmvVge1WxpG1GXONjE5xXiHuWOSO9Ae=7ATfb-VQ@mail.gmail.com>
在 2026/4/30 22:18, Filipe Manana 写道:
> On Thu, Apr 30, 2026 at 2:08 AM Qu Wenruo <wqu@suse.com> wrote:
[...]
>> + }
>> + rcu_read_unlock();
>> + invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
>
> Can we report/WARN_ON if invalidate_inode_pages2() returns an error again?
May not be a good idea, especially if we already hit a dirty eb and
warned before.
Thanks,
Qu
>
> Otherwise:
>
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
>
> Thanks.
>
>> +}
>> +
>> int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_devices)
>> {
>> u32 sectorsize;
>> @@ -3709,7 +3759,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
>> if (fs_info->data_reloc_root)
>> btrfs_drop_and_free_fs_root(fs_info, fs_info->data_reloc_root);
>> free_root_pointers(fs_info, true);
>> - invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
>> + invalidate_and_check_btree_folios(fs_info);
>>
>> fail_sb_buffer:
>> btrfs_stop_all_workers(fs_info);
>> @@ -4438,7 +4488,7 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
>> * We must make sure there is not any read request to
>> * submit after we stop all workers.
>> */
>> - invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
>> + invalidate_and_check_btree_folios(fs_info);
>> btrfs_stop_all_workers(fs_info);
>>
>> /*
>> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
>> index 8800faa8b4be..9c9dffda2b07 100644
>> --- a/fs/btrfs/extent_io.c
>> +++ b/fs/btrfs/extent_io.c
>> @@ -2882,12 +2882,6 @@ bool try_release_extent_mapping(struct folio *folio, gfp_t mask)
>> return try_release_extent_state(io_tree, folio);
>> }
>>
>> -static int extent_buffer_under_io(const struct extent_buffer *eb)
>> -{
>> - return (test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags) ||
>> - test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags));
>> -}
>> -
>> static bool folio_range_has_eb(struct folio *folio)
>> {
>> struct btrfs_folio_state *bfs;
>> diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
>> index b310a5145cf6..7b4152387d88 100644
>> --- a/fs/btrfs/extent_io.h
>> +++ b/fs/btrfs/extent_io.h
>> @@ -327,6 +327,12 @@ static inline bool extent_buffer_uptodate(const struct extent_buffer *eb)
>> return test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
>> }
>>
>> +static inline bool extent_buffer_under_io(const struct extent_buffer *eb)
>> +{
>> + return (test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags) ||
>> + test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags));
>> +}
>> +
>> int memcmp_extent_buffer(const struct extent_buffer *eb, const void *ptrv,
>> unsigned long start, unsigned long len);
>> void read_extent_buffer(const struct extent_buffer *eb, void *dst,
>> --
>> 2.54.0
>>
>>
>
prev parent reply other threads:[~2026-04-30 21:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 1:07 [PATCH v4 0/2] btrfs: fix and detect dirty/held ebs at unmount time Qu Wenruo
2026-04-30 1:07 ` [PATCH v4 1/2] btrfs: only release the dirty pages io tree after successful writes Qu Wenruo
2026-04-30 12:53 ` Filipe Manana
2026-04-30 1:07 ` [PATCH v4 2/2] btrfs: warn about extent buffer that can not be released Qu Wenruo
2026-04-30 12:48 ` Filipe Manana
2026-04-30 21:58 ` Qu Wenruo [this message]
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=24c783e3-fb72-41d2-8a82-dcebd768eff0@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=27rabbitlt@gmail.com \
--cc=fdmanana@kernel.org \
--cc=iamsyahn@gmail.com \
--cc=linux-btrfs@vger.kernel.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