From: Kovtunenko Oleksandr Date: Tue, 14 May 2019 05:52:34 +0000 (+0000) Subject: Fixed https://bugzilla.kernel.org/show_bug.cgi?id=202935 allow write on the same file X-Git-Tag: v5.2-rc1~6^2~1 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=9ab70ca653307771589e1414102c552d8dbdbbef;p=linux.git Fixed https://bugzilla.kernel.org/show_bug.cgi?id=202935 allow write on the same file Copychunk allows source and target to be on the same file. For details on restrictions see MS-SMB2 3.3.5.15.6 Signed-off-by: Kovtunenko Oleksandr Signed-off-by: Steve French --- diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index b1a5fcfa3ce1..d0cb042732cb 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1070,11 +1070,6 @@ ssize_t cifs_file_copychunk_range(unsigned int xid, cifs_dbg(FYI, "copychunk range\n"); - if (src_inode == target_inode) { - rc = -EINVAL; - goto out; - } - if (!src_file->private_data || !dst_file->private_data) { rc = -EBADF; cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n");