Skip to contentSkip to conversation

Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE

PATCH Applied Sachin Prabhu 3 participants 3 messages Apr 26, 2017 – Apr 27, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE

commit 620d8745b35d ("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 620d8745b35d ("Introduce cifs_copy_file_range()")
---
 fs/cifs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/ioctl.c +2 -1
index 265c45f..7f4bba5 100644
@@ -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,
 					src_inode->i_size, 0);
-
+	if (rc > 0)
+		rc = 0;
 out_fput:
 	fdput(src_file);
 out_drop_write:
Signature · 1 line
2.9.3

A message that is not in the archive (sent off-list or not yet received): 20170426161017.19993-1-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw

2017-04-26 9:10 GMT-07:00 Sachin Prabhu <[email protected]>:

Quoted 34 lines

commit 620d8745b35d ("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 620d8745b35d ("Introduce cifs_copy_file_range()")
---
 fs/cifs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/ioctl.c +2 -2
index 265c45f..7f4bba5 100644
@@ -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,
                                        src_inode->i_size, 0);
-
+       if (rc > 0)
+               rc = 0;
 out_fput:
        fdput(src_file);
 out_drop_write:
--

2.9.3

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Best regards,
Pavel Shilovsky

A message that is not in the archive (sent off-list or not yet received): CAKywueQ+sa9d2aTCRkUzuUeeYcEn4++dM2ru2W2t-Dq1yCHvvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Applied
#4 lore raw

merged into cifs-2.6.git for-next

Quoted 49 lines · Pavel Shilovsky

2017-04-26 9:10 GMT-07:00 Sachin Prabhu <[email protected]>:

Quoted 34 lines

commit 620d8745b35d ("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 620d8745b35d ("Introduce cifs_copy_file_range()")
---
 fs/cifs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/ioctl.c +2 -2
index 265c45f..7f4bba5 100644
@@ -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,
                                        src_inode->i_size, 0);
-
+       if (rc > 0)
+               rc = 0;
 out_fput:
        fdput(src_file);
 out_drop_write:
--

2.9.3

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Best regards,
Pavel Shilovsky
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve