mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Mike Christie <mchristi@redhat.com>,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Cc: hamish.martin@alliedtelesis.co.nz, jannh@google.com,
	pkalever@redhat.com, pkarampu@redhat.com, atumball@redhat.com,
	sabose@redhat.com
Subject: Re: [PATCH v3 3/3] uio: fix crash after the device is unregistered
Date: Tue, 10 Jul 2018 10:36:25 +0800	[thread overview]
Message-ID: <95b229de-3f9c-4474-a363-871839cf4065@redhat.com> (raw)
In-Reply-To: <5B438FF3.4040707@redhat.com>

On 2018/7/10 0:40, Mike Christie wrote:
> On 07/06/2018 08:47 PM, Xiubo Li wrote:
>> On 2018/7/7 2:58, Mike Christie wrote:
>>> On 07/05/2018 09:57 PM, xiubli@redhat.com wrote:
>>>>    void uio_event_notify(struct uio_info *info)
>>>>    {
>>>> -    struct uio_device *idev = info->uio_dev;
>>>> +    struct uio_device *idev;
>>>> +
>>>> +    if (!info)
>>>> +        return;
>>>> +
>>>> +    idev = info->uio_dev;
>>>>    
>>> For this one too, I am not sure if it is needed.
>>>
>>> uio_interrupt -> uio_event_notify. See other mail.
>>>
>>> driver XYZ -> uio_event_notify. I think drivers need to handle this and
>>> set some bits and/or perform some cleanup to make sure they are not
>>> calling uio_event_notify after it has called uio_unregister_device. The
>>> problem with the above test is if they do not they could have called
>>> uio_unregister_device right after the info test so you could still hit
>>> the problem.
>> When we are tcmu_destroy_device(), if the netlink notify event to
>> userspace is not successful then the TCMU will call the uio unregister,
>> which will set the idev->info = NULL, without close and deleting the
>> device in userspace. But the TCMU could still queue cmds to the ring
>> buffer, then the uio_event_notify will be called.
> Before tcmu_destroy_device is called LIO will have stopped new IO and
> waited for outstanding IO to be completed, so it would never be called
> after uio_unregister_device. If it does, it's a bug in LIO.
Yeah, So this should be fixed now. Only hit one crash seem related to 
uio of this code with lower kernel before.

Thanks,
BRs




  reply	other threads:[~2018-07-10  2:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  2:57 [PATCH v3 0/3] uio: fix potential crash bug xiubli
2018-07-06  2:57 ` [PATCH v3 1/3] uio: use request_threaded_irq instead xiubli
2018-07-06  2:57 ` [PATCH v3 2/3] uio: change to use the mutex lock instead of the spin lock xiubli
2018-07-06  3:39   ` Hamish Martin
2018-07-06  2:57 ` [PATCH v3 3/3] uio: fix crash after the device is unregistered xiubli
2018-07-06  3:40   ` Hamish Martin
2018-07-06 18:23   ` Mike Christie
2018-07-07  1:28     ` Xiubo Li
2018-07-09 17:06       ` Mike Christie
2018-07-10  2:40         ` Xiubo Li
2018-07-06 18:58   ` Mike Christie
2018-07-07  1:47     ` Xiubo Li
2018-07-09 16:40       ` Mike Christie
2018-07-10  2:36         ` Xiubo Li [this message]
2018-07-06  3:31 ` [PATCH v3 0/3] uio: fix potential crash bug Hamish Martin
2018-07-06 12:04   ` Xiubo Li

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=95b229de-3f9c-4474-a363-871839cf4065@redhat.com \
    --to=xiubli@redhat.com \
    --cc=atumball@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamish.martin@alliedtelesis.co.nz \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchristi@redhat.com \
    --cc=pkalever@redhat.com \
    --cc=pkarampu@redhat.com \
    --cc=sabose@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®