Skip to content

Commit

Permalink
Skip permission checks for POSIX ACL type
Browse files Browse the repository at this point in the history
zfs_zaccess_trivial() calls the generic_permission() to
read xattr attributes. This may cause a deadlock if the
xattr and dent locks were already held. This commit adds
a workaround to skip permission checks for POSIX ACL type.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
  • Loading branch information
ixhamza committed Nov 28, 2022
1 parent 99347bd commit 465cef1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion module/os/linux/zfs/zfs_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2608,8 +2608,13 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode,
return (SET_ERROR(EPERM));
}

if (zp->z_pflags & ZFS_ACL_TRIVIAL)
/*
* Workaround for POSIX ACL type to avoid deadlock
*/
if ((zp->z_pflags & ZFS_ACL_TRIVIAL) &&
zfsvfs->z_acl_type != ZFS_ACLTYPE_POSIX) {
return (zfs_zaccess_trivial(zp, working_mode, cr));
}

return (zfs_zaccess_aces_check(zp, working_mode, B_FALSE, cr));
}
Expand Down

0 comments on commit 465cef1

Please sign in to comment.