From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Brian Russell <brian.russell@brocade.com>
Cc: Brian Russell <brussell@brocade.com>,
"Hans J. Koch" <hjk@hansjkoch.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] uio: Fix uio driver to refcount device
Date: Wed, 11 Mar 2015 17:02:30 +0100 [thread overview]
Message-ID: <20150311160230.GA24028@kroah.com> (raw)
In-Reply-To: <55006668.20202@brocade.com>
On Wed, Mar 11, 2015 at 03:59:36PM +0000, Brian Russell wrote:
>
>
> On 11/03/15 15:43, Greg Kroah-Hartman wrote:
> > On Wed, Mar 11, 2015 at 03:31:42PM +0000, Brian Russell wrote:
> >> Protect uio driver from crashing if its owner is hot unplugged while there
> >> are open fds.
> >> Signed-off-by: Brian Russell <brussell@brocade.com>
> >
> > Minor nit, you need a blank line before your s-o-b: line.
> >
>
> Ack.
>
> >
> >
> >> ---
> >> drivers/uio/uio.c | 8 +++++++-
> >> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> >> index 6276f13..70ce015 100644
> >> --- a/drivers/uio/uio.c
> >> +++ b/drivers/uio/uio.c
> >> @@ -434,9 +434,11 @@ static int uio_open(struct inode *inode, struct file *filep)
> >> goto out;
> >> }
> >>
> >> + get_device(idev);
> >
> > What is the real oops caused when a device is removed? Protecting this
> > with a reference count seems ok, but it seems "heavy".
> >
>
> I'm seeing it with PCI hotplug. The PCI subsystem calls remove and the
> owner module in turn calls uio_unregister_device while app stil has
> open fds.
Sorry, I meant, what exactly is the oops message, with the callback?
What portion of code is crashing because we have an open fd? The pci
remove path of the UIO core should be fixed to handle this properly.
Not to say that your patch isn't correct, just want to see the crash to
know for sure.
thanks,
greg k-h
next prev parent reply other threads:[~2015-03-11 16:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 15:31 [PATCH] uio: Fix uio driver to refcount device Brian Russell
2015-03-11 15:43 ` Greg Kroah-Hartman
2015-03-11 15:59 ` Brian Russell
2015-03-11 16:02 ` Greg Kroah-Hartman [this message]
2015-03-11 16:15 ` Brian Russell
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=20150311160230.GA24028@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=brian.russell@brocade.com \
--cc=brussell@brocade.com \
--cc=hjk@hansjkoch.de \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox