[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0501MB22716A8F5EC6DA2A62D4B2A2D15E0@VI1PR0501MB2271.eurprd05.prod.outlook.com>
Date: Mon, 25 Mar 2019 21:29:13 +0000
From: Parav Pandit <parav@...lanox.com>
To: Kirti Wankhede <kwankhede@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>
Subject: RE: [PATCH 5/8] vfio/mdev: Avoid masking error code to EBUSY
> -----Original Message-----
> From: Kirti Wankhede <kwankhede@...dia.com>
> Sent: Monday, March 25, 2019 2:18 PM
> To: Parav Pandit <parav@...lanox.com>; kvm@...r.kernel.org; linux-
> kernel@...r.kernel.org; alex.williamson@...hat.com
> Subject: Re: [PATCH 5/8] vfio/mdev: Avoid masking error code to EBUSY
>
>
>
> On 3/23/2019 4:50 AM, Parav Pandit wrote:
> > Instead of masking return error to -EBUSY, return actual error
> > returned by the driver.
> >
> > Signed-off-by: Parav Pandit <parav@...lanox.com>
> > ---
> > drivers/vfio/mdev/mdev_core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vfio/mdev/mdev_core.c
> > b/drivers/vfio/mdev/mdev_core.c index 3d91f62..ab05464 100644
> > --- a/drivers/vfio/mdev/mdev_core.c
> > +++ b/drivers/vfio/mdev/mdev_core.c
> > @@ -142,7 +142,7 @@ static int mdev_device_remove_ops(struct
> mdev_device *mdev, bool force_remove)
> > */
> > ret = parent->ops->remove(mdev);
> > if (ret && !force_remove)
> > - return -EBUSY;
> > + return ret;
> >
> > sysfs_remove_groups(&mdev->dev.kobj, parent->ops-
> >mdev_attr_groups);
> > return 0;
> >
>
> Intentionally returned -EBUSY here. If VMM or userspace application is using
> this mdev device, vendor driver can return error.
If vendor driver detects that its busy, it must return EBUSY, not any other status.
mdev core is not supposed to mask some other error to EBUSY.
Hence the fix.
In that case sysfs interface
> should see -EBUSY error indicating device is still active.
>
> Thanks,
> Kirti
Powered by blists - more mailing lists