From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp02.citrix.com ([66.165.176.63]:51448 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756005AbcEQK1k (ORCPT ); Tue, 17 May 2016 06:27:40 -0400 From: David Vrabel To: Alexander Viro CC: David Vrabel , , , , "Boris Ostrovsky" , Juergen Gross Subject: [PATCHv1 2/2] xenfs: replace xenbus and privcmd with symlinks Date: Tue, 17 May 2016 11:27:23 +0100 Message-ID: <1463480843-3860-3-git-send-email-david.vrabel@citrix.com> In-Reply-To: <1463480843-3860-1-git-send-email-david.vrabel@citrix.com> References: <1463480843-3860-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-fsdevel-owner@vger.kernel.org List-ID: /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 -- 2.1.4