]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: Fix wrong return value checking when GETFLAGS
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Tue, 15 Nov 2022 10:39:34 +0000 (18:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:35:40 +0000 (17:35 +0100)
[ Upstream commit 92bbd67a55fee50743b42825d1c016e7fd5c79f9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/ioctl.c

index bdba9e7a94385e47694b6d6be5a9f44592da9739..c9226567309bb59ec0b00a7f3bb9310fc0c5e1af 100644 (file)
@@ -206,7 +206,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                                        rc = put_user(ExtAttrBits &
                                                FS_FL_USER_VISIBLE,
                                                (int __user *)arg);
-                               if (rc != EOPNOTSUPP)
+                               if (rc != -EOPNOTSUPP)
                                        break;
                        }
 #endif /* CONFIG_CIFS_POSIX */
@@ -235,7 +235,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                         *                     pSMBFile->fid.netfid,
                         *                     extAttrBits,
                         *                     &ExtAttrMask);
-                        * if (rc != EOPNOTSUPP)
+                        * if (rc != -EOPNOTSUPP)
                         *      break;
                         */