lkml.org 
[lkml]   [2022]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 33/34] vfio/mdev: Use the driver core to create the 'remove' file
From


On 4/11/2022 7:44 PM, Christoph Hellwig wrote:
> From: Jason Gunthorpe <jgg@nvidia.com>
>
> The device creator is supposed to use the dev.groups value to add sysfs
> files before device_add is called, not call sysfs_create_files() after
> device_add() returns. This creates a race with uevent delivery where the
> extra attribute will not be visible.
>
> This was being done because the groups had been co-opted by the mdev
> driver, now that prior patches have moved the driver's groups to the
> struct device_driver the dev.group is properly free for use here.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/vfio/mdev/mdev_core.c | 1 +
> drivers/vfio/mdev/mdev_private.h | 2 ++
> drivers/vfio/mdev/mdev_sysfs.c | 19 ++++++++++---------
> 3 files changed, 13 insertions(+), 9 deletions(-)
>

Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>

\
 
 \ /
  Last update: 2022-04-12 23:07    [W:0.249 / U:3.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site