Re: [PATCH] vfio: Use filp instead of fd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 27, 2022 at 01:21:50AM +0000, tomorrow Wang (王德明) wrote:
> Hi
> 
> Why kvm_vfio_group_add use file.
>   
>   struct file *filp;
>   .....
>   filp = fget(fd);
> 
>   .....
>   kvg->file = filp;

This is why.  Note that you've slightly misquoted it - it's actually
either "stick into kvg->file" or "fput() it".

>   ......
>   fput(filp);

The reference we are getting here is non-transient one; it will be retained
in shared data structures after we return from function - hell, after we
return to userland.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux