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: 9203785 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 01AAC60757 for ; Tue, 28 Jun 2016 18:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED34E2860F for ; Tue, 28 Jun 2016 18:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1F7328617; Tue, 28 Jun 2016 18:08:45 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 603202860F for ; Tue, 28 Jun 2016 18:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbcF1SIM (ORCPT ); Tue, 28 Jun 2016 14:08:12 -0400 Received: from smtp.citrix.com ([66.165.176.89]:62735 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbcF1SIJ (ORCPT ); Tue, 28 Jun 2016 14:08:09 -0400 X-IronPort-AV: E=Sophos;i="5.26,542,1459814400"; d="scan'208";a="363291895" From: David Vrabel To: Alexander Viro CC: David Vrabel , , , , "Boris Ostrovsky" , Juergen Gross Subject: [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks 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 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 /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