lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 kvm/queue 03/16] mm/memfd: Introduce MEMFD_OPS
On Fri, Dec 24, 2021 at 11:53:15AM +0800, Robert Hoo wrote:
> On Thu, 2021-12-23 at 20:29 +0800, Chao Peng wrote:
> > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> >
> > +static void notify_fallocate(struct inode *inode, pgoff_t start,
> > pgoff_t end)
> > +{
> > +#ifdef CONFIG_MEMFD_OPS
> > + struct shmem_inode_info *info = SHMEM_I(inode);
> > + const struct memfd_falloc_notifier *notifier;
> > + void *owner;
> > + bool ret;
> > +
> > + if (!info->falloc_notifier)
> > + return;
> > +
> > + spin_lock(&info->lock);
> > + notifier = info->falloc_notifier;
> > + if (!notifier) {
> > + spin_unlock(&info->lock);
> > + return;
> > + }
> > +
> > + owner = info->owner;
> > + ret = notifier->get_owner(owner);
> > + spin_unlock(&info->lock);
> > + if (!ret)
> > + return;
> > +
> > + notifier->fallocate(inode, owner, start, end);
>
> I see notifier->fallocate(), i.e. memfd_fallocate(), discards
> kvm_memfd_fallocate_range()'s return value. Should it be checked?

I think we can ignore it, just like how current mmu_notifier does,
the return value of __kvm_handle_hva_range is discarded in
kvm_mmu_notifier_invalidate_range_start(). Even when KVM side failed,
it's not fatal, it should not block the operation in the primary MMU.

Thanks,
Chao
>
> > + notifier->put_owner(owner);
> > +#endif
> > +}
> > +

\
 
 \ /
  Last update: 2021-12-31 03:40    [W:0.148 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site