On Mon, Dec 19, 2022 at 12:47:13AM -0800, Yi Liu wrote: > @@ -452,6 +457,11 @@ void vfio_device_close(struct vfio_device_file *df) > struct vfio_device *device = df->device; > > mutex_lock(&device->dev_set->lock); > + /* > + * Paired with smp_load_acquire() in vfio_device_fops::ioctl/ > + * read/write/mmap > + */ > + smp_store_release(&df->access_granted, false); Storing false makes no sense, it can't do anything, this function should only be called if we are in a release function so we know that there can't be concurrent access to access_granted. Jason