summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2012-11-28 10:43:11 +0000
committerBen Hutchings <ben@decadent.org.uk>2016-11-20 01:01:44 +0000
commitcef37d3ae1c1847b553e22160fe33f2892bd39d4 (patch)
tree444f593a0c633b58c0ca28be88ffd160e4067a0d /fs
parent7230a82ecc91aaf0c62b048afb15f3b8e2d8059f (diff)
downloadlinux-stable-cef37d3ae1c1847b553e22160fe33f2892bd39d4.tar.gz
linux-stable-cef37d3ae1c1847b553e22160fe33f2892bd39d4.tar.bz2
linux-stable-cef37d3ae1c1847b553e22160fe33f2892bd39d4.zip
Btrfs: skip adding an acl attribute if we don't have to
commit 755ac67f83e515af55adbfe55134eb7d90839cdb upstream. If the acl can be exactly represented in the traditional file mode permission bits, we don't set another acl attribute. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/acl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 89b156d85d63..a1f6a1be8e3e 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -121,6 +121,8 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
ret = posix_acl_equiv_mode(acl, &inode->i_mode);
if (ret < 0)
return ret;
+ if (ret == 0)
+ acl = NULL;
}
ret = 0;
break;