Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433440

Re: [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks

From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks
Date 2016-06-29 07:00 +0200
Message-ID <rPfLr-85s-3@gated-at.bofh.it> (permalink)
References <rP5Cq-20q-23@gated-at.bofh.it> <rP5Cq-20q-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <david.vrabel@citrix.com>
> ---
> 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 <xen/xen.h>
>  
>  #include "xenfs.h"
> -#include "../privcmd.h"
> -#include "../xenbus/xenbus_comms.h"
>  
>  #include <asm/xen/hypervisor.h>
>  
> @@ -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
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks David Vrabel <david.vrabel@citrix.com> - 2016-06-28 20:10 +0200
  Re: [PATCHv3 2/2] xenfs: replace xenbus and privcmd with symlinks Juergen Gross <jgross@suse.com> - 2016-06-29 07:00 +0200

csiph-web