Thread (4 messages) 4 messages, 4 authors, 2021-03-29

Re: [PATCH] btrfs: zoned: move log tree node allocation out of log_root_tree->log_mutex

From: David Sterba <hidden>
Date: 2021-03-29 18:32:21

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 <redacted>
Cc: Johannes Thumshirn <redacted>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Added to misc-next, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help