未验证 提交 2926e429 编写于 作者: D Dan Carpenter 提交者: Konstantin Komarov

fs/ntfs3: fix an error code in ntfs_get_acl_ex()

The ntfs_get_ea() function returns negative error codes or on success
it returns the length.  In the original code a zero length return was
treated as -ENODATA and results in a NULL return.  But it should be
treated as an invalid length and result in an PTR_ERR(-EINVAL) return.

Fixes: be71b5cb ("fs/ntfs3: Add attrib operations")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
上级 a1b04d38
...@@ -521,7 +521,7 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns, ...@@ -521,7 +521,7 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns,
ni_unlock(ni); ni_unlock(ni);
/* 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)) if (!IS_ERR(acl))
set_cached_acl(inode, type, acl); set_cached_acl(inode, type, acl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册