From: Greg KH <gregkh@linuxfoundation.org>
To: Pranay Srivastava <pranjas@gmail.com>
Cc: mpa@pengutronix.de, nbd-general@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH]nbd: fix might_sleep warning on socket shutdown
Date: Mon, 2 May 2016 17:15:59 -0700 [thread overview]
Message-ID: <20160503001559.GA29942@kroah.com> (raw)
In-Reply-To: <CA+aCy1ENwsOngvOn7Z2KsnFsewKjEwEbMjAddu0AGzTq8MjXSg@mail.gmail.com>
On Mon, May 02, 2016 at 08:58:34AM +0530, Pranay Srivastava wrote:
> Hi,
>
> Can the following patch be reviewed? I'm working on some more changes
> on top of this change,
> so it'll be really helpful if someone can review this patch and let me
> know of shortcomings/issues
> with this.
>
>
> On Sat, Apr 30, 2016 at 11:49 AM, Pranay Kr. Srivastava
> <pranjas@gmail.com> wrote:
> > This patch fixes the warning generated when a timeout occurs
> > on the request and socket is closed from a non-sleep context
> > by
> >
> > 1. Moving the socket closing on a timeout to nbd_thread_send
> >
> > 2. Make sock lock to be a mutex instead of a spin lock, since
> > nbd_xmit_timeout doesn't need to hold it anymore.
> >
> > 3. Move sock_shutdown outside the tx_lock in NBD_DO_IT.
Why are you doing three things in one patch?
> > ---
> > drivers/block/nbd.c | 85 +++++++++++++++++++++++++++++++----------------------
> > 1 file changed, 50 insertions(+), 35 deletions(-)
> >
> > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> > index 31e73a7..a52cc16 100644
> > --- a/drivers/block/nbd.c
> > +++ b/drivers/block/nbd.c
> > @@ -3,7 +3,7 @@
> > *
> > * Note that you can not swap over this thing, yet. Seems to work but
> > * deadlocks sometimes - you can not swap over TCP in general.
> > - *
> > + *
What did you change here?
> > * Copyright 1997-2000, 2008 Pavel Machek <pavel@ucw.cz>
> > * Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
> > *
> > @@ -35,14 +35,14 @@
> > #include <linux/types.h>
> > #include <linux/debugfs.h>
> >
> > -#include <asm/uaccess.h>
> > +#include <linux/uaccess.h>
Why change this?
> > #include <asm/types.h>
> >
> > #include <linux/nbd.h>
> >
> > struct nbd_device {
> > u32 flags;
> > - struct socket * sock; /* If == NULL, device is not ready, yet */
> > + struct socket *sock; /* If == NULL, device is not ready, yet */
You are mixing "code cleanup" changes with "change the logic" changes,
please break this up into a series of patches, doing the code cleanup
_last_ as you want to fix bugs first.
thanks,
greg k-h
next prev parent reply other threads:[~2016-05-03 0:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-30 6:19 [RESEND PATCH]nbd: Fix might sleep warning Pranay Kr. Srivastava
2016-04-30 6:19 ` [RESEND PATCH]nbd: fix might_sleep warning on socket shutdown Pranay Kr. Srivastava
2016-05-02 3:28 ` Pranay Srivastava
2016-05-03 0:15 ` Greg KH [this message]
2016-05-03 3:55 ` Pranay Srivastava
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160503001559.GA29942@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpa@pengutronix.de \
--cc=nbd-general@lists.sourceforge.net \
--cc=pranjas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.