]> 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>
Sat, 7 Mar 2015 22:02:21 +0000 (17:02 -0500)
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 fdd8fb4c6075650a874d30dd0fdfe17320ef38a3..993642199326a757f55c78dbc2722ecc2b409b60 100644 (file)
@@ -3380,7 +3380,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;
 }