linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CIFS: fiemap: do not return EINVAL if get nothing
@ 2020-03-14  3:38 Murphy Zhou
  2020-03-14 16:26 ` Pavel Shilovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Murphy Zhou @ 2020-03-14  3:38 UTC (permalink / raw)
  To: linux-cifs; +Cc: Ronnie Sahlberg, Steve French

If we call fiemap on a truncated file with none blocks allocated,
it makes sense we get nothing from this call. No output means
no blocks have been counted, but the call succeeded. It's a valid
response.

Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index c31e84ee3c39..32b7f9795d4a 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3417,7 +3417,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon,
 	if (rc)
 		goto out;
 
-	if (out_data_len < sizeof(struct file_allocated_range_buffer)) {
+	if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) {
 		rc = -EINVAL;
 		goto out;
 	}
-- 
2.20.1

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

* Re: [PATCH] CIFS: fiemap: do not return EINVAL if get nothing
  2020-03-14  3:38 [PATCH] CIFS: fiemap: do not return EINVAL if get nothing Murphy Zhou
@ 2020-03-14 16:26 ` Pavel Shilovsky
  2020-03-15  4:57   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Shilovsky @ 2020-03-14 16:26 UTC (permalink / raw)
  To: Murphy Zhou; +Cc: linux-cifs, Ronnie Sahlberg, Steve French

Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>

--
Best regards,
Pavel Shilovsky

пт, 13 мар. 2020 г. в 20:40, Murphy Zhou <jencce.kernel@gmail.com>:
>
> If we call fiemap on a truncated file with none blocks allocated,
> it makes sense we get nothing from this call. No output means
> no blocks have been counted, but the call succeeded. It's a valid
> response.
>
> Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> ---
>  fs/cifs/smb2ops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index c31e84ee3c39..32b7f9795d4a 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -3417,7 +3417,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon,
>         if (rc)
>                 goto out;
>
> -       if (out_data_len < sizeof(struct file_allocated_range_buffer)) {
> +       if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) {
>                 rc = -EINVAL;
>                 goto out;
>         }
> --
> 2.20.1

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

* Re: [PATCH] CIFS: fiemap: do not return EINVAL if get nothing
  2020-03-14 16:26 ` Pavel Shilovsky
@ 2020-03-15  4:57   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2020-03-15  4:57 UTC (permalink / raw)
  To: Pavel Shilovsky; +Cc: Murphy Zhou, linux-cifs, Ronnie Sahlberg, Steve French

merged into cifs-2.6.git for-next

On Sat, Mar 14, 2020 at 8:30 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
>
> --
> Best regards,
> Pavel Shilovsky
>
> пт, 13 мар. 2020 г. в 20:40, Murphy Zhou <jencce.kernel@gmail.com>:
> >
> > If we call fiemap on a truncated file with none blocks allocated,
> > it makes sense we get nothing from this call. No output means
> > no blocks have been counted, but the call succeeded. It's a valid
> > response.
> >
> > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> > ---
> >  fs/cifs/smb2ops.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> > index c31e84ee3c39..32b7f9795d4a 100644
> > --- a/fs/cifs/smb2ops.c
> > +++ b/fs/cifs/smb2ops.c
> > @@ -3417,7 +3417,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon,
> >         if (rc)
> >                 goto out;
> >
> > -       if (out_data_len < sizeof(struct file_allocated_range_buffer)) {
> > +       if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) {
> >                 rc = -EINVAL;
> >                 goto out;
> >         }
> > --
> > 2.20.1



-- 
Thanks,

Steve

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

end of thread, other threads:[~2020-03-15  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-14  3:38 [PATCH] CIFS: fiemap: do not return EINVAL if get nothing Murphy Zhou
2020-03-14 16:26 ` Pavel Shilovsky
2020-03-15  4:57   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).