Commit 0bd5fdb8 authored by Konstantin Komarov's avatar Konstantin Komarov

fs/ntfs3: Refactor ntfs_get_acl_ex for better readability

We can safely move set_cached_acl because it works with NULL acl too.
Reviewed-by: default avatarKari Argillander <kari.argillander@gmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent d562e901
...@@ -518,12 +518,15 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns, ...@@ -518,12 +518,15 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns,
/* Translate extended attribute to acl. */ /* Translate extended attribute to acl. */
if (err >= 0) { if (err >= 0) {
acl = posix_acl_from_xattr(mnt_userns, buf, err); acl = posix_acl_from_xattr(mnt_userns, buf, err);
if (!IS_ERR(acl)) } else if (err == -ENODATA) {
set_cached_acl(inode, type, acl); acl = NULL;
} else { } else {
acl = err == -ENODATA ? NULL : ERR_PTR(err); acl = ERR_PTR(err);
} }
if (!IS_ERR(acl))
set_cached_acl(inode, type, acl);
__putname(buf); __putname(buf);
return acl; return acl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment