aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-14 14:11:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-14 14:11:08 -0400
commitceb804cd0f63b0e0a87b81913b66add6de03043d (patch)
tree179d3050a8ea5fe5b8406efec64b5c391499d4d4 /fs
parent3474cbd11df8cdd6413781ea95bd51dd469098ff (diff)
parentf78233dd44a110c574fe760ad6f9c1e8741a0d00 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: 9p: Skip check for mandatory locks when unlocking 9p: Fixes a simple bug enabling writes beyond 2GB. 9p: Change the name of new protocol from 9p2010.L to 9p2000.L fs/9p: re-init the wstat in readdir loop net/9p: Add sysfs mount_tag file for virtio 9P device net/9p: Use the tag name in the config space for identifying mount point
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/v9fs.h6
-rw-r--r--fs/9p/vfs_dir.c11
-rw-r--r--fs/9p/vfs_file.c4
3 files changed, 15 insertions, 6 deletions
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
index 79000bf6249..6b801d1ddf4 100644
--- a/fs/9p/v9fs.h
+++ b/fs/9p/v9fs.h
@@ -24,7 +24,7 @@
24/** 24/**
25 * enum p9_session_flags - option flags for each 9P session 25 * enum p9_session_flags - option flags for each 9P session
26 * @V9FS_PROTO_2000U: whether or not to use 9P2000.u extensions 26 * @V9FS_PROTO_2000U: whether or not to use 9P2000.u extensions
27 * @V9FS_PROTO_2010L: whether or not to use 9P2010.l extensions 27 * @V9FS_PROTO_2000L: whether or not to use 9P2000.l extensions
28 * @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy 28 * @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy
29 * @V9FS_ACCESS_USER: a new attach will be issued for every user (default) 29 * @V9FS_ACCESS_USER: a new attach will be issued for every user (default)
30 * @V9FS_ACCESS_ANY: use a single attach for all users 30 * @V9FS_ACCESS_ANY: use a single attach for all users
@@ -34,7 +34,7 @@
34 */ 34 */
35enum p9_session_flags { 35enum p9_session_flags {
36 V9FS_PROTO_2000U = 0x01, 36 V9FS_PROTO_2000U = 0x01,
37 V9FS_PROTO_2010L = 0x02, 37 V9FS_PROTO_2000L = 0x02,
38 V9FS_ACCESS_SINGLE = 0x04, 38 V9FS_ACCESS_SINGLE = 0x04,
39 V9FS_ACCESS_USER = 0x08, 39 V9FS_ACCESS_USER = 0x08,
40 V9FS_ACCESS_ANY = 0x0C, 40 V9FS_ACCESS_ANY = 0x0C,
@@ -130,5 +130,5 @@ static inline int v9fs_proto_dotu(struct v9fs_session_info *v9ses)
130 130
131static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses) 131static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses)
132{ 132{
133 return v9ses->flags & V9FS_PROTO_2010L; 133 return v9ses->flags & V9FS_PROTO_2000L;
134} 134}
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 6580aa44954..d8a3afe4ff7 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -76,6 +76,15 @@ static inline int dt_type(struct p9_wstat *mistat)
76 return rettype; 76 return rettype;
77} 77}
78 78
79static void p9stat_init(struct p9_wstat *stbuf)
80{
81 stbuf->name = NULL;
82 stbuf->uid = NULL;
83 stbuf->gid = NULL;
84 stbuf->muid = NULL;
85 stbuf->extension = NULL;
86}
87
79/** 88/**
80 * v9fs_dir_readdir - read a directory 89 * v9fs_dir_readdir - read a directory
81 * @filp: opened file structure 90 * @filp: opened file structure
@@ -131,8 +140,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
131 rdir->head = 0; 140 rdir->head = 0;
132 rdir->tail = err; 141 rdir->tail = err;
133 } 142 }
134
135 while (rdir->head < rdir->tail) { 143 while (rdir->head < rdir->tail) {
144 p9stat_init(&st);
136 err = p9stat_read(rdir->buf + rdir->head, 145 err = p9stat_read(rdir->buf + rdir->head,
137 buflen - rdir->head, &st, 146 buflen - rdir->head, &st,
138 fid->clnt->proto_version); 147 fid->clnt->proto_version);
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 36122683fae..df52d488d2a 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -114,7 +114,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)
114 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); 114 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
115 115
116 /* No mandatory locks */ 116 /* No mandatory locks */
117 if (__mandatory_lock(inode)) 117 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
118 return -ENOLCK; 118 return -ENOLCK;
119 119
120 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { 120 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
@@ -215,7 +215,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
215 struct p9_fid *fid; 215 struct p9_fid *fid;
216 struct p9_client *clnt; 216 struct p9_client *clnt;
217 struct inode *inode = filp->f_path.dentry->d_inode; 217 struct inode *inode = filp->f_path.dentry->d_inode;
218 int origin = *offset; 218 loff_t origin = *offset;
219 unsigned long pg_start, pg_end; 219 unsigned long pg_start, pg_end;
220 220
221 P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data, 221 P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data,