9p: Add mksock support
authorVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Sat, 22 May 2010 17:20:30 +0000 (12:20 -0500)
committerEric Van Hensbergen <ericvh@gmail.com>
Sat, 22 May 2010 17:34:12 +0000 (12:34 -0500)
Without this patch, an attempt to mksock will get an EINVAL.

Before this patch:
[root@localhost 1dir]# mksock mysock
mksock: error making mysock: Invalid argument

With this patch:
[root@localhost 1dir]# mksock mysock
[root@localhost 1dir]# ls    -l mysock
s--------- 1 root root 0 2010-03-31 17:44 mysock

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
fs/9p/vfs_inode.c

index b44c999..29367ee 100644 (file)
@@ -1227,6 +1227,8 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
                sprintf(name, "c %u %u", MAJOR(rdev), MINOR(rdev));
        else if (S_ISFIFO(mode))
                *name = 0;
+       else if (S_ISSOCK(mode))
+               *name = 0;
        else {
                __putname(name);
                return -EINVAL;