From: David Sterba <dsterba@suse.cz>
To: ChenXiaoSong <chenxiaosong2@huawei.com>
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
zhangxiaoxu5@huawei.com, yanaijie@huawei.com,
quwenruo.btrfs@gmx.com, wqu@suse.com
Subject: Re: [PATCH v6 0/2] btrfs: fix sleep from invalid context bug in update_qgroup_limit_item()
Date: Fri, 18 Nov 2022 17:37:03 +0100 [thread overview]
Message-ID: <20221118163703.GT5824@twin.jikos.cz> (raw)
In-Reply-To: <20221116142354.1228954-1-chenxiaosong2@huawei.com>
On Wed, Nov 16, 2022 at 10:23:52PM +0800, ChenXiaoSong wrote:
> At least 3 places might sleep in update_qgroup_limit_item(), as shown below:
>
> update_qgroup_limit_item
> btrfs_alloc_path
> /* allocate memory non-atomically, might sleep */
> kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS)
> btrfs_search_slot
> setup_nodes_for_search
> reada_for_balance
> btrfs_readahead_node_child
> btrfs_readahead_tree_block
> btrfs_find_create_tree_block
> alloc_extent_buffer
> kmem_cache_zalloc
> /* allocate memory non-atomically, might sleep */
> kmem_cache_alloc(GFP_NOFS|__GFP_NOFAIL|__GFP_ZERO)
> read_extent_buffer_pages
> submit_extent_page
> /* disk IO, might sleep */
> submit_one_bio
>
> Fix this by calling qgroup_dirty() on @dstqgroup, and update limit item in
> btrfs_run_qgroups() later.
>
> By the way, add might_sleep() to some places.
>
> ChenXiaoSong (2):
> btrfs: add might_sleep() to some places in update_qgroup_limit_item()
> btrfs: qgroup: fix sleep from invalid context bug in
> update_qgroup_limit_item()
Added to misc-next with updated subjects and changelogs, thanks.
prev parent reply other threads:[~2022-11-18 16:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 14:23 ChenXiaoSong
2022-11-16 14:23 ` [PATCH v6 1/2] btrfs: add might_sleep() to some places " ChenXiaoSong
2022-11-16 14:23 ` [PATCH v6 2/2] btrfs: qgroup: fix sleep from invalid context bug " ChenXiaoSong
2022-11-16 23:16 ` Qu Wenruo
2022-11-18 16:37 ` David Sterba [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=20221118163703.GT5824@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=chenxiaosong2@huawei.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.com \
--cc=yanaijie@huawei.com \
--cc=zhangxiaoxu5@huawei.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
all inboxes | Powered by JetHome®