Re: [PATCH v2 1/1] mm: move ->mremap() from file_operations to vm_operations_struct

From: Oleg Nesterov
Date: Thu Jun 25 2015 - 19:42:44 EST


On 06/26, Kirill A. Shutemov wrote:
>
> > --- a/mm/mremap.c
> > +++ b/mm/mremap.c
> > @@ -276,8 +276,8 @@ static unsigned long move_vma(struct vm_area_struct *vma,
> > need_rmap_locks);
> > if (moved_len < old_len) {
> > err = -ENOMEM;
> > - } else if (vma->vm_file && vma->vm_file->f_op->mremap) {
> > - err = vma->vm_file->f_op->mremap(vma->vm_file, new_vma);
> > + } else if (vma->vm_ops && vma->vm_ops->mremap) {
> > + err = vma->vm_ops->mremap(new_vma);
> > }
> >
> > if (unlikely(err)) {
>
> I'm not sure what is target tree for the patch.

I hope akpm can take this patch into -mm,

> Last hunk is not going to
> apply on Linus' tree or -next. Hm?

Yes, this depends on another fix I sent to Andrew (and you ;), as 0/1
explains the change in move_vma() textually depends on another patch I sent,

[PATCH 1/4] mremap: don't leak new_vma if f_op->mremap() fails
http://marc.info/?l=linux-kernel&m=143475603713622

> Otherwise, looks good.
>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

Thanks!

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/