f2fs: fix a bug of inheriting default ACL from parent
authorKinglong Mee <kinglongmee@gmail.com>
Sat, 24 Jan 2015 09:06:25 +0000 (17:06 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 12 Feb 2015 01:04:36 +0000 (17:04 -0800)
Introduced by a6dda0e63e97122ce9e0ba04367e37cca28315fa
"f2fs: use generic posix ACL infrastructure".

When testing default acl, gets in recent kernel (3.19.0-rc5),
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

]# getfacl testdir/
user::rwx
group::rwx
                // missing an acl "group:root:rwx" inherited from parent
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/acl.c

index 7f12d28ad94cce4f1cdb746dde1e702239e381ee..742202779bd517029ff8a910a361f37181c530f6 100644 (file)
@@ -396,7 +396,7 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
                posix_acl_release(default_acl);
        }
        if (acl) {
-               if (error)
+               if (!error)
                        error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl,
                                               ipage);
                posix_acl_release(acl);