From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752787AbcICAVM (ORCPT ); Fri, 2 Sep 2016 20:21:12 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:35492 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbcICAVG (ORCPT ); Fri, 2 Sep 2016 20:21:06 -0400 Date: Sat, 3 Sep 2016 01:20:52 +0100 From: Al Viro To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, luto@amacapital.net, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, 0x7f454c46@gmail.com, oleg@redhat.com, rostedt@goodmis.org Subject: Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping Message-ID: <20160903002051.GA2356@ZenIV.linux.org.uk> References: <20160825152110.25663-1-dsafonov@virtuozzo.com> <20160825152110.25663-2-dsafonov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160825152110.25663-2-dsafonov@virtuozzo.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: > + unsigned long n_addr = mmap_region(vdso_file_64, text_start, > + image->size, VM_READ|VM_EXEC| > + VM_DONTEXPAND|VM_SOFTDIRTY| > + VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, 0); > + if (text_start != n_addr) { > + pr_err("Failed to mmap vdso file at %lx, mmap_region returned %lx\n", > + text_start, n_addr); > + goto old_way; > + } > + vma = find_vma(mm, text_start); > + if (IS_ERR(vma) || vma->vm_start != text_start) { > + pr_err("Failed to find vdso mapped vma at %lx\n", > + text_start); > + goto old_way; Umm... Since when can find_vma() return ERR_PTR()? > + d_set_d_op(path.dentry, &vdso_dops); Nope. Set ->s_d_op to &vdso_dops and be done with that. > +static struct file_system_type vdso_fs_type = { > + .name = "vdsofs", > + .mount = ramfs_mount, Probably the wrong thing here. Just use a simple wrapper using mount_pseudo() for all work; see fs/aio.c:aio_mount(). > + ret = register_filesystem(&vdso_fs_type); Do you really want it user-mountable? If not, no need to register...