]> git.hungrycats.org Git - linux/commitdiff
Btrfs: insert_new_root: Fix lock type of the extent buffer.
authorchandan <chandan@linux.vnet.ibm.com>
Thu, 15 Jan 2015 06:52:03 +0000 (12:22 +0530)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Fri, 27 Mar 2015 03:27:38 +0000 (23:27 -0400)
btrfs_alloc_tree_block() returns an extent buffer on which a blocked lock has
been taken. Hence assign the appropriate value to path->locks[level].

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 95449a1626fb6b643b576b9fbafed02793627577)

fs/btrfs/ctree.c

index 527e927c667a2ad23750e49098613bb40524497b..7725c040c4e4d1b89ddeef983d66fea670130c7e 100644 (file)
@@ -3383,7 +3383,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
        add_root_to_dirty_list(root);
        extent_buffer_get(c);
        path->nodes[level] = c;
-       path->locks[level] = BTRFS_WRITE_LOCK;
+       path->locks[level] = BTRFS_WRITE_LOCK_BLOCKING;
        path->slots[level] = 0;
        return 0;
 }