On Thu, Feb 04, 2021 at 02:54:25PM +0000, Johannes Thumshirn wrote: > On 04/02/2021 12:57, Filipe Manana wrote: > > On Thu, Feb 4, 2021 at 10:23 AM Naohiro Aota <naohiro.aota@xxxxxxx> wrote: > >> --- a/fs/btrfs/tree-log.c > >> +++ b/fs/btrfs/tree-log.c > >> @@ -3159,6 +3159,19 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, > >> list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); > >> root_log_ctx.log_transid = log_root_tree->log_transid; > >> > >> + if (btrfs_is_zoned(fs_info)) { > >> + mutex_lock(&fs_info->tree_log_mutex); > >> + if (!log_root_tree->node) { > > > > As commented in v14, the log root tree is not protected by > > fs_info->tree_log_mutex anymore. > > It is fs_info->tree_root->log_mutex as of 5.10. > > > > Everything else was addressed and looks good. > > Thanks. > > David, can you add this or should we send an incremental patch? > This survived fstests -g quick run with lockdep enabled. > > diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c > index 7ba044bfa9b1..36c4a60d20dc 100644 > --- a/fs/btrfs/tree-log.c > +++ b/fs/btrfs/tree-log.c > @@ -3160,7 +3160,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, > root_log_ctx.log_transid = log_root_tree->log_transid; > if (btrfs_is_zoned(fs_info)) { > - mutex_lock(&fs_info->tree_log_mutex); > + mutex_lock(&fs_info->tree_root->log_mutex); > if (!log_root_tree->node) { > ret = btrfs_alloc_log_tree_node(trans, log_root_tree); > if (ret) { > @@ -3169,7 +3169,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, > goto out; > } > } > - mutex_unlock(&fs_info->tree_log_mutex); > + mutex_unlock(&fs_info->tree_root->log_mutex); Folded to the patch, thanks.