From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbcF2EvA (ORCPT ); Wed, 29 Jun 2016 00:51:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:47506 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbcF2Eu7 (ORCPT ); Wed, 29 Jun 2016 00:50:59 -0400 Subject: Re: [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks To: David Vrabel , Alexander Viro References: <1467137167-28546-1-git-send-email-david.vrabel@citrix.com> <1467137167-28546-3-git-send-email-david.vrabel@citrix.com> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky From: Juergen Gross Message-ID: <577353AF.8080506@suse.com> Date: Wed, 29 Jun 2016 06:50:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1467137167-28546-3-git-send-email-david.vrabel@citrix.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/16 20:06, David Vrabel wrote: > /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 > --- I think you should make xen_xenbus_fops and xen_privcmd_fops static now that they are no longer referenced by super.c Juergen > 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 >