Thread (72 messages) 72 messages, 4 authors, 2021-02-22

Re: [PATCH v15 41/42] btrfs: zoned: reorder log node allocation on zoned filesystem

From: David Sterba <hidden>
Date: 2021-02-04 16:01:55
Also in: linux-fsdevel

On Thu, Feb 04, 2021 at 02:54:25PM +0000, Johannes Thumshirn wrote:
quoted hunk ↗ jump to hunk
On 04/02/2021 12:57, Filipe Manana wrote:
quoted
On Thu, Feb 4, 2021 at 10:23 AM Naohiro Aota [off-list ref] wrote:
quoted
--- 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help