Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7bbdb3a authored by Zhang Xiaoxu's avatar Zhang Xiaoxu Committed by Greg Kroah-Hartman
Browse files

cifs: Fix wrong return value checking when GETFLAGS



[ Upstream commit 92bbd67a55fee50743b42825d1c016e7fd5c79f9 ]

The return value of CIFSGetExtAttr is negative, should be checked
with -EOPNOTSUPP rather than EOPNOTSUPP.

Fixes: 64a5cfa6 ("Allow setting per-file compression via SMB2/3")
Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fda0ba7c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -206,7 +206,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
					rc = put_user(ExtAttrBits &
					rc = put_user(ExtAttrBits &
						FS_FL_USER_VISIBLE,
						FS_FL_USER_VISIBLE,
						(int __user *)arg);
						(int __user *)arg);
				if (rc != EOPNOTSUPP)
				if (rc != -EOPNOTSUPP)
					break;
					break;
			}
			}
#endif /* CONFIG_CIFS_POSIX */
#endif /* CONFIG_CIFS_POSIX */
@@ -235,7 +235,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
			 *		       pSMBFile->fid.netfid,
			 *		       pSMBFile->fid.netfid,
			 *		       extAttrBits,
			 *		       extAttrBits,
			 *		       &ExtAttrMask);
			 *		       &ExtAttrMask);
			 * if (rc != EOPNOTSUPP)
			 * if (rc != -EOPNOTSUPP)
			 *	break;
			 *	break;
			 */
			 */