mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
cifs: Fix xid leak in cifs_copy_file_range()
[ Upstream commit9a97df404a] If the file is used by swap, before return -EOPNOTSUPP, should free the xid, otherwise, the xid will be leaked. Fixes:4e8aea30f7("smb3: enable swap on SMB3 mounts") Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
05cc22c008
commit
bf49d4fe4a
|
|
@ -1221,8 +1221,11 @@ static ssize_t cifs_copy_file_range(struct file *src_file, loff_t off,
|
||||||
ssize_t rc;
|
ssize_t rc;
|
||||||
struct cifsFileInfo *cfile = dst_file->private_data;
|
struct cifsFileInfo *cfile = dst_file->private_data;
|
||||||
|
|
||||||
if (cfile->swapfile)
|
if (cfile->swapfile) {
|
||||||
return -EOPNOTSUPP;
|
rc = -EOPNOTSUPP;
|
||||||
|
free_xid(xid);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
rc = cifs_file_copychunk_range(xid, src_file, off, dst_file, destoff,
|
rc = cifs_file_copychunk_range(xid, src_file, off, dst_file, destoff,
|
||||||
len, flags);
|
len, flags);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user