summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-09-22 18:28:36 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-09-24 17:39:57 +0300
commit0bd5fdb811b0449fcef948a100099cc3197f1b73 (patch)
treefa2641f943a39bb482c06107c4c9f6901d2bcbd6
parentd562e901f25d275b55b0496fe01935beeff0ed37 (diff)
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: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
-rw-r--r--fs/ntfs3/xattr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 5c7c5c7a5ec1..3795943efc8e 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -518,12 +518,15 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns,
/* Translate extended attribute to acl. */
if (err >= 0) {
acl = posix_acl_from_xattr(mnt_userns, buf, err);
- if (!IS_ERR(acl))
- set_cached_acl(inode, type, acl);
+ } else if (err == -ENODATA) {
+ acl = NULL;
} else {
- acl = err == -ENODATA ? NULL : ERR_PTR(err);
+ acl = ERR_PTR(err);
}
+ if (!IS_ERR(acl))
+ set_cached_acl(inode, type, acl);
+
__putname(buf);
return acl;