From patchwork Mon May 16 17:44:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 9104831 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EAB8A9F1D3 for ; Mon, 16 May 2016 17:46:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24007201B4 for ; Mon, 16 May 2016 17:46:21 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 442F020155 for ; Mon, 16 May 2016 17:46:20 +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 1b2MZ0-0004yr-1c; Mon, 16 May 2016 17:44: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 1b2MYx-0004yV-VV for xen-devel@lists.xenproject.org; Mon, 16 May 2016 17:44:16 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 15/45-29997-FE60A375; Mon, 16 May 2016 17:44:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrrBXvcdm1W 4wb0Z1hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bnv0uZClbwVnx9/pe1gXE9dxcjJ4eEgL/E yekP2UFsNgEdicdLZgDZHBwiAioSt/cagISZBaokrlz6zApiCwt4SUxc85EZxGYRUJWY+246I 4jNK+Au8fH9U1aIkXIS54//ZAYZwyngIbH7Dw9IWAio5PrhHSwQtorEx7WrWCFaBSVOznzCAr FKQuLgixdgrRIC3BJ/u+0nMPLNQlI1C0nVAkamVYwaxalFZalFuoaGeklFmekZJbmJmTm6hga mermpxcWJ6ak5iUnFesn5uZsYgeHEAAQ7GFe2Ox9ilORgUhLlfchkFS7El5SfUpmRWJwRX1Sa k1p8iFGGg0NJgncRK1BOsCg1PbUiLTMHGNgwaQkOHiUR3m6QNG9xQWJucWY6ROoUo6KUOK8aS EIAJJFRmgfXBoumS4yyUsK8jECHCPEUpBblZpagyr9iFOdgVBLmjQWZwpOZVwI3/RXQYiagxR PMLEAWlyQipKQaGPk5Jd43fpkqoc3/6MLzyjkn126d6PBPyfLzJYc01n65BK62TXq7nSb+Pn3 sQsLB84+XPlCKP6JqNOGVVNFZ94vP9uopJN3dHbi6LUt4toRDnHKfqeX6q10TmzgsJvw90/5f Ud9/14Zrs3PF1rDIbpvz0+zG14vzeqSDLxaFPTxxqnK7lfTWVWZKLMUZiYZazEXFiQAjKqu7o QIAAA== X-Env-Sender: prvs=937e80a62=david.vrabel@citrix.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1463420652!39966791!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48140 invoked from network); 16 May 2016 17:44:14 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 May 2016 17:44:14 -0000 X-IronPort-AV: E=Sophos;i="5.26,627,1459814400"; d="scan'208";a="361318581" From: David Vrabel To: Date: Mon, 16 May 2016 18:44:06 +0100 Message-ID: <1463420646-29530-3-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1463420646-29530-1-git-send-email-david.vrabel@citrix.com> References: <1463420646-29530-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Juergen Gross , Boris Ostrovsky , David Vrabel Subject: [Xen-devel] [PATCHv1 2/2] xen/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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP /proc/xen/xenbus does not work correctly. A read blocked waiting for a xenbus message will deadlock a write to the same file handle due to the requirement for atomic file position updates on regular files. /proc/xen/xenbus and /proc/xen/privcmd are supposed to be identical to the character devices /dev/xen/xenbus and /dev/xen/privcmd so replace the files with symlinks. Signed-off-by: David Vrabel --- drivers/xen/xenfs/super.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c index 8559a71..09c239e 100644 --- a/drivers/xen/xenfs/super.c +++ b/drivers/xen/xenfs/super.c @@ -45,16 +45,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