From 04e6863b19c72279bcbeffa26d85d649ab9c8205 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Fri, 12 Apr 2019 16:02:58 +0800 Subject: 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/acl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fs/btrfs/acl.c') 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); -- cgit v1.2.3