All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "zhanghongtao (A)" <zhanghongtao22@huawei.com>
Cc: akpm@linux-foundation.org, linfeilong@huawei.com,
	suweifeng1@huawei.com, linux-kernel@vger.kernel.org,
	io-uring@vger.kernel.org
Subject: Re: [PATCH] drivers:uio: Fix system crashes during driver switchover
Date: Tue, 17 May 2022 09:34:27 +0200	[thread overview]
Message-ID: <YoNQA0OuGtj2Q9o3@kroah.com> (raw)
In-Reply-To: <889918de-e0b8-1ee1-ab86-ca02c8aa35b9@huawei.com>

On Wed, May 11, 2022 at 04:51:11PM +0800, zhanghongtao (A) wrote:
> Thanks for your reply.
> I looked through the historical emails and thought I was not the
> same problem as his.
> After the driver is switched, the application can still operate
> on the mapped address, which causes the system to crash.
> The application is not aware of the driver's switchover.
> The solution I can think of is to block the switch and wait for
> the application to release before switching, as shown in the patch.
> So want to seek help from the community, how to solve it better?
> Is there a better way?

Yes, do not unbind the driver from the device unless all userspace
programs have stopped using the device.

Also, do not use the UIO driver for disk devices, that way is crazy, use
a real block driver.  What prevents you from doing that today?

thanks,

greg k-h

  parent reply	other threads:[~2022-05-17  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11  6:34 [PATCH] drivers:uio: Fix system crashes during driver switchover zhanghongtao (A)
2022-05-11  6:48 ` Greg KH
2022-05-11  8:51   ` zhanghongtao (A)
2022-05-11 10:09     ` Greg KH
2022-05-17  7:34     ` Greg KH [this message]
2022-05-11 12:45 ` Christoph Hellwig

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=YoNQA0OuGtj2Q9o3@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=io-uring@vger.kernel.org \
    --cc=linfeilong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suweifeng1@huawei.com \
    --cc=zhanghongtao22@huawei.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.