linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] cifs: Silently ignore unknown oplock break handle
@ 2021-03-19 13:57 Vincent Whitchurch
  2021-03-19 14:03 ` Tom Talpey
  2021-03-25 15:32 ` Paulo Alcantara
  0 siblings, 2 replies; 4+ messages in thread
From: Vincent Whitchurch @ 2021-03-19 13:57 UTC (permalink / raw)
  To: Steve French
  Cc: kernel, tom, Vincent Whitchurch, linux-cifs, samba-technical,
	linux-kernel

Make SMB2 not print out an error when an oplock break is received for an
unknown handle, similar to SMB1.  The debug message which is printed for
these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and
opens, reads, and writes the same file from another thread triggers the
below errors several times a minute when run against a Samba server
configured with "smb2 leases = no".

 CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
 00000010: 00000001 00000000 ffffffff ffffffff  ................
 00000020: 00000000 00000000 00000000 00000000  ................
 00000030: 00000000 00000000 00000000 00000000  ................

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---

Notes:
    v3:
    - Change debug print to Tom Talpey's suggestion
    
    v2:
    - Drop change to lease break
    - Rewrite commit message

 fs/cifs/smb2misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index 60d4bd1eae2b..76cd05b8d53b 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
 		}
 	}
 	spin_unlock(&cifs_tcp_ses_lock);
-	cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
-	return false;
+	cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
+	return true;
 }
 
 void
-- 
2.28.0


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

* Re: [PATCH v3] cifs: Silently ignore unknown oplock break handle
  2021-03-19 13:57 [PATCH v3] cifs: Silently ignore unknown oplock break handle Vincent Whitchurch
@ 2021-03-19 14:03 ` Tom Talpey
  2021-03-25 15:21   ` Steve French
  2021-03-25 15:32 ` Paulo Alcantara
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Talpey @ 2021-03-19 14:03 UTC (permalink / raw)
  To: Vincent Whitchurch, Steve French
  Cc: kernel, linux-cifs, samba-technical, linux-kernel

LGTM feel free to add

Reviewed-By: Tom Talpey <tom@talpey.com>

On 3/19/2021 9:57 AM, Vincent Whitchurch wrote:
> Make SMB2 not print out an error when an oplock break is received for an
> unknown handle, similar to SMB1.  The debug message which is printed for
> these unknown handles may also be misleading, so fix that too.
> 
> The SMB2 lease break path is not affected by this patch.
> 
> Without this, a program which writes to a file from one thread, and
> opens, reads, and writes the same file from another thread triggers the
> below errors several times a minute when run against a Samba server
> configured with "smb2 leases = no".
> 
>   CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
>   00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
>   00000010: 00000001 00000000 ffffffff ffffffff  ................
>   00000020: 00000000 00000000 00000000 00000000  ................
>   00000030: 00000000 00000000 00000000 00000000  ................
> 
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> ---
> 
> Notes:
>      v3:
>      - Change debug print to Tom Talpey's suggestion
>      
>      v2:
>      - Drop change to lease break
>      - Rewrite commit message
> 
>   fs/cifs/smb2misc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
> index 60d4bd1eae2b..76cd05b8d53b 100644
> --- a/fs/cifs/smb2misc.c
> +++ b/fs/cifs/smb2misc.c
> @@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
>   		}
>   	}
>   	spin_unlock(&cifs_tcp_ses_lock);
> -	cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
> -	return false;
> +	cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
> +	return true;
>   }
>   
>   void
> 

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

* Re: [PATCH v3] cifs: Silently ignore unknown oplock break handle
  2021-03-19 14:03 ` Tom Talpey
@ 2021-03-25 15:21   ` Steve French
  0 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2021-03-25 15:21 UTC (permalink / raw)
  To: Tom Talpey
  Cc: Vincent Whitchurch, Steve French, CIFS, kernel, samba-technical, LKML

merged into cifs-2.6.git for-next

On Fri, Mar 19, 2021 at 9:06 AM Tom Talpey via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> LGTM feel free to add
>
> Reviewed-By: Tom Talpey <tom@talpey.com>
>
> On 3/19/2021 9:57 AM, Vincent Whitchurch wrote:
> > Make SMB2 not print out an error when an oplock break is received for an
> > unknown handle, similar to SMB1.  The debug message which is printed for
> > these unknown handles may also be misleading, so fix that too.
> >
> > The SMB2 lease break path is not affected by this patch.
> >
> > Without this, a program which writes to a file from one thread, and
> > opens, reads, and writes the same file from another thread triggers the
> > below errors several times a minute when run against a Samba server
> > configured with "smb2 leases = no".
> >
> >   CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
> >   00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
> >   00000010: 00000001 00000000 ffffffff ffffffff  ................
> >   00000020: 00000000 00000000 00000000 00000000  ................
> >   00000030: 00000000 00000000 00000000 00000000  ................
> >
> > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> > ---
> >
> > Notes:
> >      v3:
> >      - Change debug print to Tom Talpey's suggestion
> >
> >      v2:
> >      - Drop change to lease break
> >      - Rewrite commit message
> >
> >   fs/cifs/smb2misc.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
> > index 60d4bd1eae2b..76cd05b8d53b 100644
> > --- a/fs/cifs/smb2misc.c
> > +++ b/fs/cifs/smb2misc.c
> > @@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
> >               }
> >       }
> >       spin_unlock(&cifs_tcp_ses_lock);
> > -     cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
> > -     return false;
> > +     cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
> > +     return true;
> >   }
> >
> >   void
> >
>


-- 
Thanks,

Steve

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

* Re: [PATCH v3] cifs: Silently ignore unknown oplock break handle
  2021-03-19 13:57 [PATCH v3] cifs: Silently ignore unknown oplock break handle Vincent Whitchurch
  2021-03-19 14:03 ` Tom Talpey
@ 2021-03-25 15:32 ` Paulo Alcantara
  1 sibling, 0 replies; 4+ messages in thread
From: Paulo Alcantara @ 2021-03-25 15:32 UTC (permalink / raw)
  To: Vincent Whitchurch, Steve French
  Cc: kernel, tom, Vincent Whitchurch, linux-cifs, samba-technical,
	linux-kernel

Vincent Whitchurch <vincent.whitchurch@axis.com> writes:

> Make SMB2 not print out an error when an oplock break is received for an
> unknown handle, similar to SMB1.  The debug message which is printed for
> these unknown handles may also be misleading, so fix that too.
>
> The SMB2 lease break path is not affected by this patch.
>
> Without this, a program which writes to a file from one thread, and
> opens, reads, and writes the same file from another thread triggers the
> below errors several times a minute when run against a Samba server
> configured with "smb2 leases = no".
>
>  CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
>  00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
>  00000010: 00000001 00000000 ffffffff ffffffff  ................
>  00000020: 00000000 00000000 00000000 00000000  ................
>  00000030: 00000000 00000000 00000000 00000000  ................
>
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> ---
>
> Notes:
>     v3:
>     - Change debug print to Tom Talpey's suggestion
>     
>     v2:
>     - Drop change to lease break
>     - Rewrite commit message
>
>  fs/cifs/smb2misc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>

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

end of thread, other threads:[~2021-03-25 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 13:57 [PATCH v3] cifs: Silently ignore unknown oplock break handle Vincent Whitchurch
2021-03-19 14:03 ` Tom Talpey
2021-03-25 15:21   ` Steve French
2021-03-25 15:32 ` Paulo Alcantara

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).