summaryrefslogtreecommitdiff
path: root/fs/btrfs/acl.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2019-04-12 11:02:58 +0300
committerDavid Sterba <dsterba@suse.com>2019-04-29 20:02:44 +0300
commit04e6863b19c72279bcbeffa26d85d649ab9c8205 (patch)
tree9b8c3dead2ef66371726b7b16a155d2903ff3218 /fs/btrfs/acl.c
parent353c2ea735e4b54fb6250861e67b51b1bcb47198 (diff)
downloadlinux-04e6863b19c72279bcbeffa26d85d649ab9c8205.tar.xz
btrfs: split btrfs_setxattr calls regarding transaction
When the caller has already created the transaction handle, btrfs_setxattr() will use it. Also adds assert in btrfs_setxattr(). Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r--fs/btrfs/acl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index d3b04c6abc61..7fe6551bc59b 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -93,7 +93,11 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans,
goto out;
}
- ret = btrfs_setxattr_trans(trans, inode, name, value, size, 0);
+ if (trans)
+ ret = btrfs_setxattr(trans, inode, name, value, size, 0);
+ else
+ ret = btrfs_setxattr_trans(NULL, inode, name, value, size, 0);
+
out:
kfree(value);