aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/fid.h
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@gmail.com>2007-01-26 03:57:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-26 16:51:00 -0500
commitda977b2c7eb4d6312f063a7b486f2aad99809710 (patch)
treebb8a2afc766c16e3349e03dfb8a706dca6408395 /fs/9p/fid.h
parentff76e1dfc8728278ee231feeb93146f9c57c3ec3 (diff)
[PATCH] 9p: fix segfault caused by race condition in meta-data operations
Running dbench multithreaded exposed a race condition where fid structures were removed while in use. This patch adds semaphores to meta-data operations to protect the fid structure. Some cleanup of error-case handling in the inode operations is also included. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/9p/fid.h')
-rw-r--r--fs/9p/fid.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/9p/fid.h b/fs/9p/fid.h
index aa974d6875c3..48fc170c26c8 100644
--- a/fs/9p/fid.h
+++ b/fs/9p/fid.h
@@ -30,6 +30,8 @@ struct v9fs_fid {
30 struct list_head list; /* list of fids associated with a dentry */ 30 struct list_head list; /* list of fids associated with a dentry */
31 struct list_head active; /* XXX - debug */ 31 struct list_head active; /* XXX - debug */
32 32
33 struct semaphore lock;
34
33 u32 fid; 35 u32 fid;
34 unsigned char fidopen; /* set when fid is opened */ 36 unsigned char fidopen; /* set when fid is opened */
35 unsigned char fidclunked; /* set when fid has already been clunked */ 37 unsigned char fidclunked; /* set when fid has already been clunked */
@@ -55,3 +57,6 @@ struct v9fs_fid *v9fs_fid_get_created(struct dentry *);
55void v9fs_fid_destroy(struct v9fs_fid *fid); 57void v9fs_fid_destroy(struct v9fs_fid *fid);
56struct v9fs_fid *v9fs_fid_create(struct v9fs_session_info *, int fid); 58struct v9fs_fid *v9fs_fid_create(struct v9fs_session_info *, int fid);
57int v9fs_fid_insert(struct v9fs_fid *fid, struct dentry *dentry); 59int v9fs_fid_insert(struct v9fs_fid *fid, struct dentry *dentry);
60struct v9fs_fid *v9fs_fid_clone(struct dentry *dentry);
61void v9fs_fid_clunk(struct v9fs_session_info *v9ses, struct v9fs_fid *fid);
62