Commit 7d0c234f authored by Sachin Prabhu's avatar Sachin Prabhu Committed by Steve French

Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE

commit 620d8745 ("Introduce cifs_copy_file_range()") changes the
behaviour of the cifs ioctl call CIFS_IOC_COPYCHUNK_FILE. In case of
successful writes, it now returns the number of bytes written. This
return value is treated as an error by the xfstest cifs/001. Depending
on the errno set at that time, this may or may not result in the test
failing.

The patch fixes this by setting the return value to 0 in case of
successful writes.

Fixes: commit 620d8745 ("Introduce cifs_copy_file_range()")
Reported-by: default avatarEryu Guan <eguan@redhat.com>
Signed-off-by: default avatarSachin Prabhu <sprabhu@redhat.com>
Acked-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent cd8c4296
...@@ -74,7 +74,8 @@ static long cifs_ioctl_copychunk(unsigned int xid, struct file *dst_file, ...@@ -74,7 +74,8 @@ static long cifs_ioctl_copychunk(unsigned int xid, struct file *dst_file,
rc = cifs_file_copychunk_range(xid, src_file.file, 0, dst_file, 0, rc = cifs_file_copychunk_range(xid, src_file.file, 0, dst_file, 0,
src_inode->i_size, 0); src_inode->i_size, 0);
if (rc > 0)
rc = 0;
out_fput: out_fput:
fdput(src_file); fdput(src_file);
out_drop_write: out_drop_write:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment