From: Liu Bo Date: Wed, 28 Nov 2012 10:43:11 +0000 (+0000) Subject: Btrfs: skip adding an acl attribute if we don't have to X-Git-Tag: MMI-PSA29.97-13-9~15079^2~41 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=755ac67f83e515af55adbfe55134eb7d90839cdb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Btrfs: skip adding an acl attribute if we don't have to 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 0c16e3dbfd56..e15d2b0d8d3b 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;