From patchwork Tue Jun 28 18:06:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9203779 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 DEFF3608A6 for ; Tue, 28 Jun 2016 18:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D669828610 for ; Tue, 28 Jun 2016 18:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB11F28614; Tue, 28 Jun 2016 18:08:23 +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 4A91928610 for ; Tue, 28 Jun 2016 18:08:23 +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 1bHxOy-0003C9-73; Tue, 28 Jun 2016 18:06:24 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHxOx-0003Bq-Co for xen-devel@lists.xenproject.org; Tue, 28 Jun 2016 18:06:23 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id C5/62-22092-E9CB2775; Tue, 28 Jun 2016 18:06:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrohUnfenqJ wg//b+Sy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxVl/qZC27zV1y8ztPAuJ63i5GDQ0LAX6L7 fHYXIycHm4COxOMlM9hBbBEg+3fDWZYuRi4OZoEHjBJPfr1iBEkIC7hJHFp6AayIRUBV4vOEq 2BxXgF3iYNrD7CB2BICchLnj/9kBrE5BTwkLixfCmYLAdU8an7DDmGrSHxcu4oVoldQ4uTMJy wgNrOAhMTBFy+YIW7jlvjbbT+BkW8WkqpZSKoWMDKtYlQvTi0qSy3SNdZLKspMzyjJTczM0TU 0MNPLTS0uTkxPzUlMKtZLzs/dxAgMJwYg2MHY8c/pEKMkB5OSKG/d2qJwIb6k/JTKjMTijPii 0pzU4kOMMhwcShK8jruBcoJFqempFWmZOcDAhklLcPAoifBmgqR5iwsSc4sz0yFSpxgVpcR55 UASAiCJjNI8uDZYNF1ilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMK8tyBSezLwSuOmvgBYzAS 1mrc4HWVySiJCSamAUZk7l2Nx56+achx6/fq3jeLFBtKs4wDXqmFKFosOZtwoObxifGZo/3qw 2NVHd7bK4cJCtqciW87sK459u4jZSsIuw7Gm0On4t02nGjPeTjj6v2uy1qWL26t3OLozLjWTU ftUpcO499vvf/Xu6CczCx0/9jNrnGfxW3q1jeojm0vqug8b56xiUWIozEg21mIuKEwFBJvK2o QIAAA== X-Env-Sender: prvs=980c37e66=david.vrabel@citrix.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1467137179!20782757!2 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: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55922 invoked from network); 28 Jun 2016 18:06:22 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2016 18:06:22 -0000 X-IronPort-AV: E=Sophos;i="5.26,542,1459814400"; d="scan'208";a="363291895" From: David Vrabel To: Alexander Viro Date: Tue, 28 Jun 2016 19:06:07 +0100 Message-ID: <1467137167-28546-3-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1467137167-28546-1-git-send-email-david.vrabel@citrix.com> References: <1467137167-28546-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Juergen Gross , linux-kernel@vger.kernel.org, David Vrabel , linux-fsdevel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Subject: [Xen-devel] [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks 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 /proc/xen/xenbus does not work correctly. A read blocked waiting for a xenstore message holds the mutex needed for atomic file position updates. This blocks any writes on the same file handle, which can deadlock if the write is needed to unblock the read. /proc/xen/xenbus is supposed to be identical to the character device /dev/xen/xenbus so replace the file with a symlink. Similarly, replace /proc/xen/privcmd with a symlink since it should be the same as /dev/xen/privcmd. Signed-off-by: David Vrabel --- v2: - remove unneeded includes --- drivers/xen/xenfs/super.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c index 8559a71..0f2e2cd 100644 --- a/drivers/xen/xenfs/super.c +++ b/drivers/xen/xenfs/super.c @@ -18,8 +18,6 @@ #include #include "xenfs.h" -#include "../privcmd.h" -#include "../xenbus/xenbus_comms.h" #include @@ -45,16 +43,16 @@ static const struct file_operations capabilities_file_ops = { static int xenfs_fill_super(struct super_block *sb, void *data, int silent) { static struct tree_descr xenfs_files[] = { - [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR }, + [2] = { "xenbus", NULL, S_IFLNK | S_IRWXUGO, "/dev/xen/xenbus" }, { "capabilities", &capabilities_file_ops, S_IRUGO }, - { "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR }, + { "privcmd", NULL, S_IFLNK | S_IRWXUGO, "/dev/xen/privcmd" }, {""}, }; static struct tree_descr xenfs_init_files[] = { - [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR }, + [2] = { "xenbus", NULL, S_IFLNK | S_IRWXUGO, "/dev/xen/xenbus" }, { "capabilities", &capabilities_file_ops, S_IRUGO }, - { "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR }, + { "privcmd", NULL, S_IFLNK | S_IRWXUGO, "/dev/xen/privcmd" }, { "xsd_kva", &xsd_kva_file_ops, S_IRUSR|S_IWUSR}, { "xsd_port", &xsd_port_file_ops, S_IRUSR|S_IWUSR}, #ifdef CONFIG_XEN_SYMS