Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE
@ 2017-04-26 16:10 Sachin Prabhu
       [not found] ` <20170426161017.19993-1-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Sachin Prabhu @ 2017-04-26 16:10 UTC (permalink / raw)
  To: linux-cifs

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()")
Reported-by: Eryu Guan <eguan-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 265c45f..7f4bba5 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE
       [not found] ` <20170426161017.19993-1-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2017-04-26 23:37   ` Pavel Shilovsky
       [not found]     ` <CAKywueQ+sa9d2aTCRkUzuUeeYcEn4++dM2ru2W2t-Dq1yCHvvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Shilovsky @ 2017-04-26 23:37 UTC (permalink / raw)
  To: Sachin Prabhu; +Cc: linux-cifs

2017-04-26 9:10 GMT-07:00 Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> 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()")
> Reported-by: Eryu Guan <eguan-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/ioctl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
> index 265c45f..7f4bba5 100644
> --- a/fs/cifs/ioctl.c
> +++ b/fs/cifs/ioctl.c
> @@ -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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Acked-by: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>

--
Best regards,
Pavel Shilovsky

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE
       [not found]     ` <CAKywueQ+sa9d2aTCRkUzuUeeYcEn4++dM2ru2W2t-Dq1yCHvvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-04-27 20:08       ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2017-04-27 20:08 UTC (permalink / raw)
  To: Pavel Shilovsky; +Cc: Sachin Prabhu, linux-cifs

merged into cifs-2.6.git for-next

On Wed, Apr 26, 2017 at 6:37 PM, Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2017-04-26 9:10 GMT-07:00 Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>> 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()")
>> Reported-by: Eryu Guan <eguan-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> Signed-off-by: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>  fs/cifs/ioctl.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
>> index 265c45f..7f4bba5 100644
>> --- a/fs/cifs/ioctl.c
>> +++ b/fs/cifs/ioctl.c
>> @@ -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
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Acked-by: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
>
> --
> Best regards,
> Pavel Shilovsky
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-27 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 16:10 [PATCH] Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE Sachin Prabhu
     [not found] ` <20170426161017.19993-1-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-26 23:37   ` Pavel Shilovsky
     [not found]     ` <CAKywueQ+sa9d2aTCRkUzuUeeYcEn4++dM2ru2W2t-Dq1yCHvvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-27 20:08       ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox