On Wed, Mar 24, 2021 at 11:23:11PM +0900, Naohiro Aota wrote:
> Commit 6e37d2459941 ("btrfs: zoned: fix deadlock on log sync") pointed out
> a deadlock warning and removed
> mutex_{lock,unlock}(&fs_info->tree_root->log_mutex). While it looks like it
> always cause a deadlock, we didn't see actual deadlock in fstests runs. The
> reason is log_root_tree->log_mutex != fs_info->tree_root->log_mutex, not
> taking the same lock. So, the warning was actually a false-positive.
> 
> Since btrfs_alloc_log_tree_node() is protected only by
> fs_info->tree_root->log_mutex, we can (and should) move the code out of the
> lock scope of log_root_tree->log_mutex and silence the warning.
> 
> Cc: Filipe Manana <fdman...@suse.com>
> Cc: Johannes Thumshirn <johannes.thumsh...@wdc.com>
> Signed-off-by: Naohiro Aota <naohiro.a...@wdc.com>

Added to misc-next, thanks.

Reply via email to