On Mon, Jan 30, 2023 at 09:47:08AM +0000, Liu, Yi L wrote: > The reason is the df->kvm was referenced in vfio_device_first_open() in > the below commit. To avoid race, a common lock is needed between the > set_kvm thread and the open thread. For group path, group_lock is used. > However, for cdev path, there may be no group_lock compiled, so need > to use another one. And dev_set->lock happens to be used in the open > path, so use it avoids to adding another specific lock. Add a comment around the kvm pointer in the struct that it is weirdly locked Jason