On 10/30/23 11:05, Christian Brauner wrote:
@Paolo and @Sean, does that make sense and is the series for v6.7 or just already in -next for v6.8?
It's for 6.8. Thanks for the fixup! Paolo
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c index 94bc478c26f3..a4c194b0b22c 100644 --- a/virt/kvm/guest_memfd.c +++ b/virt/kvm/guest_memfd.c @@ -272,17 +272,7 @@ static int kvm_gmem_release(struct inode *inode, struct file *file) static struct file *kvm_gmem_get_file(struct kvm_memory_slot *slot) { - struct file *file; - - rcu_read_lock(); - - file = rcu_dereference(slot->gmem.file); - if (file && !get_file_rcu(file)) - file = NULL; - - rcu_read_unlock(); - - return file; + return get_file_active(&slot->gmem.file); } static struct file_operations kvm_gmem_fops = {