Btrfs: skip adding an acl attribute if we don't have to
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 28 Nov 2012 10:43:11 +0000 (10:43 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:15 +0000 (20:46 -0500)
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>
fs/btrfs/acl.c

index 0c16e3dbfd5681ea67d4cf2f349cb33083a46d2d..e15d2b0d8d3b20f3085c18348e9d711682fedc24 100644 (file)
@@ -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;