[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30699b42-a587-7235-5fec-e745cd5c925d@nvidia.com>
Date: Sat, 19 May 2018 01:08:07 +0530
From: Kirti Wankhede <kwankhede@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
CC: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<cohuck@...hat.com>, <pasic@...ux.ibm.com>
Subject: Re: [PATCH v4 2/2] vfio/mdev: Re-order sysfs attribute creation
On 5/19/2018 12:40 AM, Alex Williamson wrote:
> There exists a gap at the end of mdev_device_create() where the device
> is visible to userspace, but we're not yet ready to handle removal, as
> triggered through the 'remove' attribute. We handle this properly in
> mdev_device_remove() with an -EAGAIN return, but we can marginally
> reduce this gap by adding this attribute as a final step of our sysfs
> setup.
>
> Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
Looks good.
Reviewed by: Kirti Wankhede <kwankhede@...dia.com>
> ---
> drivers/vfio/mdev/mdev_sysfs.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
> index 802df210929b..249472f05509 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -257,24 +257,24 @@ int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type)
> {
> int ret;
>
> - ret = sysfs_create_files(&dev->kobj, mdev_device_attrs);
> - if (ret)
> - return ret;
> -
> ret = sysfs_create_link(type->devices_kobj, &dev->kobj, dev_name(dev));
> if (ret)
> - goto device_link_failed;
> + return ret;
>
> ret = sysfs_create_link(&dev->kobj, &type->kobj, "mdev_type");
> if (ret)
> goto type_link_failed;
>
> + ret = sysfs_create_files(&dev->kobj, mdev_device_attrs);
> + if (ret)
> + goto create_files_failed;
> +
> return ret;
>
> +create_files_failed:
> + sysfs_remove_link(&dev->kobj, "mdev_type");
> type_link_failed:
> sysfs_remove_link(type->devices_kobj, dev_name(dev));
> -device_link_failed:
> - sysfs_remove_files(&dev->kobj, mdev_device_attrs);
> return ret;
> }
>
>
Powered by blists - more mailing lists