diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 16:13:33 +0100 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 16:13:33 +0100 |
commit | 49550787a90b5bfa44d8dc424d11824dbe21473d (patch) | |
tree | fa32ae34a162eab3b96c2f1740aa64af822b5e5f /Documentation/vfio-mediated-device.txt | |
parent | vfio/type1: Restore mapping performance with mdev support (diff) | |
download | linux-49550787a90b5bfa44d8dc424d11824dbe21473d.tar.xz linux-49550787a90b5bfa44d8dc424d11824dbe21473d.zip |
vfio-mdev: Fix remove race
Using the mtty mdev sample driver we can generate a remove race by
starting one shell that continuously creates mtty devices and several
other shells all attempting to remove devices, in my case four remove
shells. The fault occurs in mdev_remove_sysfs_files() where the
passed type arg is NULL, which suggests we've received a struct device
in mdev_device_remove() but it's in some sort of teardown state. The
solution here is to make use of the accidentally unused list_head on
the mdev_device such that the mdev core keeps a list of all the mdev
devices. This allows us to validate that we have a valid mdev before
we start removal, remove it from the list to prevent others from
working on it, and if the vendor driver refuses to remove, we can
re-add it to the list.
Cc: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'Documentation/vfio-mediated-device.txt')
0 files changed, 0 insertions, 0 deletions