From patchwork Tue Aug 30 15:17:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 9305539 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 44E2A607F0 for ; Tue, 30 Aug 2016 15:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35C68288E3 for ; Tue, 30 Aug 2016 15:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A8B328C0E; Tue, 30 Aug 2016 15:17:59 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96592288E3 for ; Tue, 30 Aug 2016 15:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbcH3PRl (ORCPT ); Tue, 30 Aug 2016 11:17:41 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:33606 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752116AbcH3PRk (ORCPT ); Tue, 30 Aug 2016 11:17:40 -0400 Received: by mail-oi0-f49.google.com with SMTP id c15so30380424oig.0 for ; Tue, 30 Aug 2016 08:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=X18FHLwZ+Y0nCpC05NIniGygdKCdPCwc95EZsIlSoic=; b=kw1au1X1rouyn7Vi4dqt5K6sJxampKZFF7g9cASNiTeB6nXmapDC2oC0Yf5RzEOClQ yASY1IEw6fvku0RXqzXO0AsFJtZIZarjAR5zDgjtU1zurWbMv/dZDiWiaatre2JS4ve9 8b7A7TkNBRpVGuix3KfVNd1uxpINXYOFL9XQIZN0RFDCaRAqWebstXTciZcDapHgkrwR JSjaBqtSkAPgvcDsEKhvp+G+ZF/Imfx+qygZvMjS94U34E+V42dWMpAZdanceD4xF9ER YrcqEw9UW8a2jAp95uZaGtsMIFpOfvyNKrBoRtRbmKxLpnBZnxB5148hmLQoXFp5l7Xq mW1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X18FHLwZ+Y0nCpC05NIniGygdKCdPCwc95EZsIlSoic=; b=Tyt+GWbufXTOtSQtPRugbQZFfl7ju0aZ3QE43GsczuX0T/jNQJZFIaCD96mKTlt+Zb asaPyAtbbXHw+yXqyMDb4+P9FrEHvWrYx6qn0UupL2c86QFyg30pEn9PCeko9cNCtyHb GgD1VhTlZUzfw/5BLH6Mn2RAuVBTBN/lUCtv6nyair6EVwBy+eoZZ3OZ5mol+rL3NZJK dwLjbnIVvE5kMg0Em0kVCxFUhmA+ZkV1KIRQ6yjS8rQaxBJ2ApyvbWUHWSH4SzrGYRSJ FiyyCMDdT3w1QJJkQIPoXcmNwTrjQ3af3H++APUH77jk5E22w69AKOfpQspnjii3k9Oc Dx3g== X-Gm-Message-State: AE9vXwPLnxFt9N4lM50FIY9OjIA7clVYrhbY5ubxay0ZWZ1YcierjQL5o9ihMopho8CIjNrl X-Received: by 10.157.17.72 with SMTP id p8mr4783955otp.120.1472570259025; Tue, 30 Aug 2016 08:17:39 -0700 (PDT) Received: from localhost ([2605:a601:aac:b820:244a:faf5:8635:6d4a]) by smtp.gmail.com with ESMTPSA id a5sm13255291oii.3.2016.08.30.08.17.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 08:17:38 -0700 (PDT) From: Seth Forshee To: "Eric W. Biederman" , Boris Ostrovsky , David Vrabel , Juergen Gross Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, Seth Forshee , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] xenbus: Use proc_create_mount_point() to create /proc/xen Date: Tue, 30 Aug 2016 10:17:31 -0500 Message-Id: <1472570251-62679-1-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Acked-by: David Vrabel Signed-off-by: Seth Forshee --- Resending to add some Cc's I missed the first time. 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 33a31cfef55d..b5c1dec4a7c2 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 c633476616e0..be014c544d50 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -477,6 +477,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 7931c558c192..ff7259559d70 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 b97bf2ef996e..8bd2f726436a 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,