[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACGkMEuSFFvo=6DGKA-beUs0XZiWS3R+OpqcHa8eChf4twt+rQ@mail.gmail.com>
Date: Tue, 7 Sep 2021 11:33:45 +0800
From: Jason Wang <jasowang@...hat.com>
To: Xie Yongji <xieyongji@...edance.com>
Cc: mst <mst@...hat.com>,
virtualization <virtualization@...ts.linux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vduse: Cleanup the old kernel states after reset failure
On Mon, Sep 6, 2021 at 10:22 PM Xie Yongji <xieyongji@...edance.com> wrote:
>
> We should cleanup the old kernel states e.g. interrupt callback
> no matter whether the userspace handle the reset correctly or not
> since virtio-vdpa can't handle the reset failure now.
>
> Otherwise, the old state might be used after reset which might
> break something, e.g. the old interrupt callback might be triggered
> by userspace after reset, which can break the virtio device driver.
>
> Signed-off-by: Xie Yongji <xieyongji@...edance.com>
> ---
> drivers/vdpa/vdpa_user/vduse_dev.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c
> index 59a93e5b967a..61695521066c 100644
> --- a/drivers/vdpa/vdpa_user/vduse_dev.c
> +++ b/drivers/vdpa/vdpa_user/vduse_dev.c
> @@ -665,13 +665,11 @@ static void vduse_vdpa_set_config(struct vdpa_device *vdpa, unsigned int offset,
> static int vduse_vdpa_reset(struct vdpa_device *vdpa)
> {
> struct vduse_dev *dev = vdpa_to_vduse(vdpa);
> -
> - if (vduse_dev_set_status(dev, 0))
> - return -EIO;
> + int ret = vduse_dev_set_status(dev, 0);
>
> vduse_dev_reset(dev);
>
> - return 0;
> + return ret;
> }
>
> static u32 vduse_vdpa_get_generation(struct vdpa_device *vdpa)
> --
> 2.11.0
>
Acked-by: Jason Wang <jasowang@...hat.com>
Powered by blists - more mailing lists