Re: [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2019-11-11 17:23:27
Also in:
kvm, lkml
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2019-11-11 17:23:27
Also in:
kvm, lkml
On Mon, Nov 11, 2019 at 08:47:12AM -0800, Stephen Hemminger wrote:
On Mon, 11 Nov 2019 01:49:20 -0800 "Greg KH" [off-list ref] wrote:quoted
quoted
+ ret = sysfs_create_bin_file(&channel->kobj,&ring_buffer_bin_attr);quoted
+ if (ret) + dev_notice(&dev->device, + "sysfs create ring bin file failed; %d\n",ret);quoted
+Again, don't create sysfs files on your own, the bus code should be doing this for you automatically and in a way that is race-free. thanks, greg k-hThe sysfs file is only created if the VFIO/UIO driveris used.
That's even worse. Again, sysfs files should be automatically created by the driver core when the device is created. To randomly add/remove random files after that happens means userspace is never notified of that and that's not good. We've been working for a while to fix up these types of races, don't purposfully add new ones for no good reason please :) thanks, greg k-h