cifs: always add credits back for unsolicited PDUs
diff mbox series

Message ID 20190705204308.10039-1-lsahlber@redhat.com
State New
Headers show
Series
  • cifs: always add credits back for unsolicited PDUs
Related show

Commit Message

Ronnie Sahlberg July 5, 2019, 8:43 p.m. UTC
not just if CONFIG_CIFS_DEBUG2 is enabled.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French July 5, 2019, 8:52 p.m. UTC | #1
Thoughts on stable?

On Fri, Jul 5, 2019 at 3:43 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> not just if CONFIG_CIFS_DEBUG2 is enabled.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 8c4121da624e..11adca981263 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -1221,11 +1221,11 @@ cifs_demultiplex_thread(void *p)
>                                          atomic_read(&midCount));
>                                 cifs_dump_mem("Received Data is: ", bufs[i],
>                                               HEADER_SIZE(server));
> +                               smb2_add_credits_from_hdr(bufs[i], server);
>  #ifdef CONFIG_CIFS_DEBUG2
>                                 if (server->ops->dump_detail)
>                                         server->ops->dump_detail(bufs[i],
>                                                                  server);
> -                               smb2_add_credits_from_hdr(bufs[i], server);
>                                 cifs_dump_mids(server);
>  #endif /* CIFS_DEBUG2 */
>                         }
> --
> 2.13.6
>
Steve French July 5, 2019, 9:07 p.m. UTC | #2
Tentatively merged these two patches into cifs-2.6.git for-next pending testing

On Fri, Jul 5, 2019 at 3:43 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> not just if CONFIG_CIFS_DEBUG2 is enabled.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 8c4121da624e..11adca981263 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -1221,11 +1221,11 @@ cifs_demultiplex_thread(void *p)
>                                          atomic_read(&midCount));
>                                 cifs_dump_mem("Received Data is: ", bufs[i],
>                                               HEADER_SIZE(server));
> +                               smb2_add_credits_from_hdr(bufs[i], server);
>  #ifdef CONFIG_CIFS_DEBUG2
>                                 if (server->ops->dump_detail)
>                                         server->ops->dump_detail(bufs[i],
>                                                                  server);
> -                               smb2_add_credits_from_hdr(bufs[i], server);
>                                 cifs_dump_mids(server);
>  #endif /* CIFS_DEBUG2 */
>                         }
> --
> 2.13.6
>
ronnie sahlberg July 5, 2019, 9:08 p.m. UTC | #3
On Sat, Jul 6, 2019 at 7:04 AM Steve French <smfrench@gmail.com> wrote:
>
> Thoughts on stable?

Yeah, maybe. It should be very rare that this would trigger but it
could and would lead to a hung connection.

>
> On Fri, Jul 5, 2019 at 3:43 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
> >
> > not just if CONFIG_CIFS_DEBUG2 is enabled.
> >
> > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > ---
> >  fs/cifs/connect.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> > index 8c4121da624e..11adca981263 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -1221,11 +1221,11 @@ cifs_demultiplex_thread(void *p)
> >                                          atomic_read(&midCount));
> >                                 cifs_dump_mem("Received Data is: ", bufs[i],
> >                                               HEADER_SIZE(server));
> > +                               smb2_add_credits_from_hdr(bufs[i], server);
> >  #ifdef CONFIG_CIFS_DEBUG2
> >                                 if (server->ops->dump_detail)
> >                                         server->ops->dump_detail(bufs[i],
> >                                                                  server);
> > -                               smb2_add_credits_from_hdr(bufs[i], server);
> >                                 cifs_dump_mids(server);
> >  #endif /* CIFS_DEBUG2 */
> >                         }
> > --
> > 2.13.6
> >
>
>
> --
> Thanks,
>
> Steve

Patch
diff mbox series

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8c4121da624e..11adca981263 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1221,11 +1221,11 @@  cifs_demultiplex_thread(void *p)
 					 atomic_read(&midCount));
 				cifs_dump_mem("Received Data is: ", bufs[i],
 					      HEADER_SIZE(server));
+				smb2_add_credits_from_hdr(bufs[i], server);
 #ifdef CONFIG_CIFS_DEBUG2
 				if (server->ops->dump_detail)
 					server->ops->dump_detail(bufs[i],
 								 server);
-				smb2_add_credits_from_hdr(bufs[i], server);
 				cifs_dump_mids(server);
 #endif /* CIFS_DEBUG2 */
 			}