From patchwork Fri Oct 28 15:52:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9402193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CA4C6022E for ; Fri, 28 Oct 2016 15:55:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C9A92A86C for ; Fri, 28 Oct 2016 15:55:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D3762A86A; Fri, 28 Oct 2016 15:55:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93F882A86A for ; Fri, 28 Oct 2016 15:55:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c09Sg-0005Fr-Dl; Fri, 28 Oct 2016 15:52:54 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c09Sf-0005FE-Af for xen-devel@lists.xenproject.org; Fri, 28 Oct 2016 15:52:53 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 55/B7-01148-45473185; Fri, 28 Oct 2016 15:52:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRWlGSWpSXmKPExsXitHRDpG5IiXC EwbrzQhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bpnh2sBcskKhr6wxsYb4p0MXJySAj4S1y7 e4sdxGYT0JF4vGQGmC0CZP9uOMvSxcjFwSzQxySx+OZ3VpCEMFDDr0vngIo4OFgEVCUmfOYBC fMKuEms+T2FHWKmnMT54z+ZQWxOAXeJna8eMYLYQkA19178ZoWwVSQ+rl3FCtErKHFy5hMWEJ tZQELi4IsXzCDjJQS4Jf52209g5JuFpGoWkqoFjEyrGNWLU4vKUot0zfSSijLTM0pyEzNzdA0 NzPRyU4uLE9NTcxKTivWS83M3MQLDiQEIdjDOO+F/iFGSg0lJlPdDuHCEEF9SfkplRmJxRnxR aU5q8SFGGQ4OJQneW0VAOcGi1PTUirTMHGBgw6QlOHiURHgjioHSvMUFibnFmekQqVOMuhxvd r18wCTEkpeflyolzvsUZIYASFFGaR7cCFiUXWKUlRLmZQQ6SoinILUoN7MEVf4VozgHo5Iwrx LIKp7MvBK4Ta+AjmACOmJ6ugDIESWJCCmpBkb9pCsvGJ2WhDvO7GLOnHwo/nH97f8vhEMD9Zo K+/V/P9ixKoWPyTtmX+eCg5LMjB43TL/WLpio9e3Zo+y8r4nbusuWMG1Z8P9c3M1avq1q+nH/ QkMF1mW9YOS6WLnv3hSBeT1fWI7ybMk10HqrVTRjgZunWuG1xoOnJkmZ/uvYxmnw497frfuVW IozEg21mIuKEwFvId9FrQIAAA== X-Env-Sender: prvs=102855286=david.vrabel@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1477669969!68002189!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46427 invoked from network); 28 Oct 2016 15:52:52 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 28 Oct 2016 15:52:52 -0000 X-IronPort-AV: E=Sophos;i="5.31,410,1473120000"; d="scan'208";a="386656936" From: David Vrabel To: Alexander Viro Date: Fri, 28 Oct 2016 16:52:39 +0100 Message-ID: <1477669959-9486-4-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477669959-9486-1-git-send-email-david.vrabel@citrix.com> References: <1477669959-9486-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Juergen Gross , linux-kernel@vger.kernel.org, Seth Forshee , David Vrabel , linux-fsdevel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Subject: [Xen-devel] [PATCHv4 3/3] xenfs: Use proc_create_mount_point() to create /proc/xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Seth Forshee Mounting proc in user namespace containers fails if the xenbus filesystem is mounted on /proc/xen because this directory fails the "permanently empty" test. proc_create_mount_point() exists specifically to create such mountpoints in proc but is currently proc-internal. Export this interface to modules, then use it in xenbus when creating /proc/xen. Signed-off-by: Seth Forshee Signed-off-by: David Vrabel --- drivers/xen/xenbus/xenbus_probe.c | 2 +- fs/proc/generic.c | 1 + fs/proc/internal.h | 1 - include/linux/proc_fs.h | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 33a31cf..b5c1dec 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -826,7 +826,7 @@ static int __init xenbus_init(void) * Create xenfs mountpoint in /proc for compatibility with * utilities that expect to find "xenbus" under "/proc/xen". */ - proc_mkdir("xen", NULL); + proc_create_mount_point("xen"); #endif out_error: diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 5f2dc20..7eb3cef 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -479,6 +479,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name) } return ent; } +EXPORT_SYMBOL(proc_create_mount_point); struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, struct proc_dir_entry *parent, diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 5378441..7de6795 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -195,7 +195,6 @@ static inline bool is_empty_pde(const struct proc_dir_entry *pde) { return S_ISDIR(pde->mode) && !pde->proc_iops; } -struct proc_dir_entry *proc_create_mount_point(const char *name); /* * inode.c diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index b97bf2e..8bd2f72 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -21,6 +21,7 @@ extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, struct proc_dir_entry *, void *); extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t, struct proc_dir_entry *); +struct proc_dir_entry *proc_create_mount_point(const char *name); extern struct proc_dir_entry *proc_create_data(const char *, umode_t, struct proc_dir_entry *, @@ -56,6 +57,7 @@ static inline struct proc_dir_entry *proc_symlink(const char *name, struct proc_dir_entry *parent,const char *dest) { return NULL;} static inline struct proc_dir_entry *proc_mkdir(const char *name, struct proc_dir_entry *parent) {return NULL;} +static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; } static inline struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,