From patchwork Mon Nov 14 11:12:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9427233 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 23DE56047D for ; Mon, 14 Nov 2016 11:15:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15BE328697 for ; Mon, 14 Nov 2016 11:15:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A8D7286BB; Mon, 14 Nov 2016 11:15:31 +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 9AE5E28697 for ; Mon, 14 Nov 2016 11:15:30 +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 1c6FCQ-0002Kb-RB; Mon, 14 Nov 2016 11:13:18 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6FCP-0002KE-TM for xen-devel@lists.xenproject.org; Mon, 14 Nov 2016 11:13:18 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id DA/85-13537-D4C99285; Mon, 14 Nov 2016 11:13:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRWlGSWpSXmKPExsXitHRDpK7PHM0 Ig0mrjSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozTPTtYC5ZJVDT0hzcw3hTpYuTkkBDwl/i1 6xIjiM0moCPxeMkM9i5GDg4RARWJ23sNQMLMAssYJdrOaYDYwkDlU061MIHYLAKqEs27noG18 gq4S8y72swGMVJO4vzxn8wgNqeAh8S6qXNYQGwhoJoZlx4yQdgqEh/XrmKF6BWUODnzCQvELg mJgy9eMIOcICHALfG3234CI98sJFWzkFQtYGRaxahRnFpUllqka2Sul1SUmZ5RkpuYmaNraGC ql5taXJyYnpqTmFSsl5yfu4kRGE71DAyMOxivbvE7xCjJwaQkyhsfqRkhxJeUn1KZkVicEV9U mpNafIhRhoNDSYJ3ziygnGBRanpqRVpmDjCwYdISHDxKIrzrQNK8xQWJucWZ6RCpU4y6HG92v XzAJMSSl5+XKiXOmwFSJABSlFGaBzcCFmWXGGWlhHkZGRgYhHgKUotyM0tQ5V8xinMwKgnzXg KZwpOZVwK36RXQEUxAR+wy1wA5oiQRISXVwFitJzTf9PAP5WahHSzdR9MnJa9QqGjM8N7x/Ja lPwfPhdeblJWdSuM9jh+y42rd8b3Xpa2/9/z1PWyz1/ZpxHbF6zPMy9ByL3xqarNwura1ke+t JrGfTLH6n1o/T5p348iz0Nj2OcU6tcef/vV3n8v0fdLXZf+8uVNfvf+TmZ3NYzVvj9xXBSWW4 oxEQy3mouJEAD5zIsStAgAA X-Env-Sender: prvs=11962ba05=david.vrabel@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1479121993!69980379!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.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30028 invoked from network); 14 Nov 2016 11:13:16 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 14 Nov 2016 11:13:16 -0000 X-IronPort-AV: E=Sophos;i="5.31,638,1473120000"; d="scan'208";a="389329978" From: David Vrabel To: Date: Mon, 14 Nov 2016 11:12:56 +0000 Message-ID: <1479121976-26568-3-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479121976-26568-1-git-send-email-david.vrabel@citrix.com> References: <1479121976-26568-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Juergen Gross , Seth Forshee , Boris Ostrovsky , David Vrabel Subject: [Xen-devel] [PATCHv5 2/2] 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,