Re: [PATCH] btrfs: fix lock inversion problem when doing qgroup extent tracing
From: Filipe Manana <fdmanana@kernel.org>
Date: 2021-07-22 15:01:54
On Thu, Jul 22, 2021 at 2:26 PM David Sterba [off-list ref] wrote:
On Wed, Jul 21, 2021 at 05:31:48PM +0100, fdmanana@kernel.org wrote:quoted
int btrfs_find_all_roots(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, u64 bytenr, u64 time_seq, struct ulist **roots, - bool ignore_offset) + bool ignore_offset, bool skip_commit_root_sem)AFAICS, all callers pass false for ignore_offset, it's obvious from the patch that updated all call sites.quoted
+ ret = btrfs_find_all_roots(NULL, trans->fs_info, bytenr, 0, &old_root, + false, true);quoted
ret = btrfs_find_all_roots(NULL, fs_info, record->bytenr, 0, - &record->old_roots, false); + &record->old_roots, false, false);quoted
ret = btrfs_find_all_roots(trans, fs_info, - record->bytenr, BTRFS_SEQ_LAST, &new_roots, false); + record->bytenr, BTRFS_SEQ_LAST, &new_roots, false, false);quoted
ret = btrfs_find_all_roots(NULL, fs_info, found.objectid, 0, - &roots, false); + &roots, false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, - false); + false, false);quoted
ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, - false); + false, false);The ignore_offset was added for the BTRFS_IOC_LOGICAL_INO_V2 ioctl, but it's not used anywhere with btrfs_find_all_roots, only btrfs_find_all_roots_safe that does the lookup by find_parent_nodes and passed further to low level helpers. It's been there since c995ab3cda3f ("btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents"), and the parameter was added to btrfs_find_all_roots maybe for completeness but I'd rather remove it. As your patch is a fix and for stable@, the cleanup should be a followup.
Yes, agreed. Just sent out a patch for that. Thanks.
Added to misc-next, thanks.