Unverified Commit 2926e429 authored by Dan Carpenter's avatar Dan Carpenter Committed by Konstantin Komarov
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent a1b04d38
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns,
		ni_unlock(ni);

	/* Translate extended attribute to acl */
	if (err > 0) {
	if (err >= 0) {
		acl = posix_acl_from_xattr(mnt_userns, buf, err);
		if (!IS_ERR(acl))
			set_cached_acl(inode, type, acl);