diff mbox

[PATCHv1,2/2] xen/xenfs: replace xenbus and privcmd with symlinks

Message ID 1463420646-29530-3-git-send-email-david.vrabel@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Vrabel May 16, 2016, 5:44 p.m. UTC
/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 <david.vrabel@citrix.com>
---
 drivers/xen/xenfs/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

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