]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix number of transaction units required to create symlink
authorFilipe Manana <fdmanana@suse.com>
Thu, 31 Dec 2015 18:16:29 +0000 (18:16 +0000)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Tue, 19 Jan 2016 05:23:43 +0000 (00:23 -0500)
We weren't accounting for the insertion of an inline extent item for the
symlink inode nor that we need to update the parent inode item (through
the call to btrfs_add_nondir()). So fix this by including two more
transaction units.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
(cherry picked from commit 9269d12b2d57d9e3d13036bb750762d1110d425c)
(cherry picked from commit 668584fd5d1cfb883a4d1b4f1902612e9d12bab1)

fs/btrfs/inode.c

index 34199c1d64ccd634c6432001a92c352d0e3923e9..645c5749b7eca63b29648ec08e1f88f81ccf2a80 100644 (file)
@@ -9527,9 +9527,11 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
        /*
         * 2 items for inode item and ref
         * 2 items for dir items
+        * 1 item for updating parent inode item
+        * 1 item for the inline extent item
         * 1 item for xattr if selinux is on
         */
-       trans = btrfs_start_transaction(root, 5);
+       trans = btrfs_start_transaction(root, 7);
        if (IS_ERR(trans))
                return PTR_ERR(trans);