From: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Date: Tue, 15 Nov 2022 18:39:34 +0800
Subject: [PATCH] cifs: Fix wrong return value checking when GETFLAGS
Git-commit: 92bbd67a55fee50743b42825d1c016e7fd5c79f9
References: bsc#1190317
Patch-mainline: v6.1-rc6
The return value of CIFSGetExtAttr is negative, should be checked
with -EOPNOTSUPP rather than EOPNOTSUPP.
Fixes: 64a5cfa6db94 ("Allow setting per-file compression via SMB2/3")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
---
fs/cifs/ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -243,7 +243,7 @@ long cifs_ioctl(struct file *filep, unsi
rc = put_user(ExtAttrBits &
FS_FL_USER_VISIBLE,
(int __user *)arg);
- if (rc != EOPNOTSUPP)
+ if (rc != -EOPNOTSUPP)
break;
}
#endif /* CONFIG_CIFS_POSIX */
@@ -272,7 +272,7 @@ long cifs_ioctl(struct file *filep, unsi
* pSMBFile->fid.netfid,
* extAttrBits,
* &ExtAttrMask);
- * if (rc != EOPNOTSUPP)
+ * if (rc != -EOPNOTSUPP)
* break;
*/