Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cifs: Fix wrong return value checking when GETFLAGS

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>

authored by

Zhang Xiaoxu and committed by
Steve French
92bbd67a d520de6c

+2 -2
+2 -2
fs/cifs/ioctl.c
··· 343 343 rc = put_user(ExtAttrBits & 344 344 FS_FL_USER_VISIBLE, 345 345 (int __user *)arg); 346 - if (rc != EOPNOTSUPP) 346 + if (rc != -EOPNOTSUPP) 347 347 break; 348 348 } 349 349 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ ··· 373 373 * pSMBFile->fid.netfid, 374 374 * extAttrBits, 375 375 * &ExtAttrMask); 376 - * if (rc != EOPNOTSUPP) 376 + * if (rc != -EOPNOTSUPP) 377 377 * break; 378 378 */ 379 379