Skip to content

Commit

Permalink
Drop redundant POSIX ACL check in zpl_init_acl()
Browse files Browse the repository at this point in the history
ZFS_ACLTYPE_POSIXACL has already been tested in zpl_init_acl(),
so no need to test again on POSIX ACL access.

Reviewed by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Tomohiro Kusumi <[email protected]>
Closes openzfs#9009
  • Loading branch information
kusumi authored and tonyhutter committed Aug 13, 2019
1 parent 138bb84 commit e0e6711
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions module/zfs/zpl_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,12 +1130,9 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
return (0);

if (!S_ISLNK(ip->i_mode)) {
if (ITOZSB(ip)->z_acl_type == ZFS_ACLTYPE_POSIXACL) {
acl = zpl_get_acl(dir, ACL_TYPE_DEFAULT);
if (IS_ERR(acl))
return (PTR_ERR(acl));
}

acl = zpl_get_acl(dir, ACL_TYPE_DEFAULT);
if (IS_ERR(acl))
return (PTR_ERR(acl));
if (!acl) {
ip->i_mode &= ~current_umask();
ip->i_ctime = current_time(ip);
Expand All @@ -1144,7 +1141,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
}
}

if ((ITOZSB(ip)->z_acl_type == ZFS_ACLTYPE_POSIXACL) && acl) {
if (acl) {
umode_t mode;

if (S_ISDIR(ip->i_mode)) {
Expand Down

0 comments on commit e0e6711

Please sign in to comment.