diff options
author | Latchesar Ionkov <lucho@ionkov.net> | 2006-01-08 04:05:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:14:06 -0500 |
commit | 1dac06b20dcc8078dab037bd70652c69c67ba672 (patch) | |
tree | 34436f474074aa2760604555e3aa9b02df18fce2 /fs/9p/v9fs.c | |
parent | 531b1094b74365dcc55fa464d28a9a2497ae825d (diff) |
[PATCH] v9fs: handle kthread_create failure, minor bugfixes
- remove unnecessary -ENOMEM assignments
- return correct value when buf_check_size for second time in a buffer
- handle failures when create_workqueue and kthread_create are called
- use kzalloc instead of kmalloc/memset 0
- v9fs_str_copy and v9fs_str_compare were buggy, were used only in one
place, correct the logic and move it to the place it is used.
Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p/v9fs.c')
-rw-r--r-- | fs/9p/v9fs.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 519b21d8b15b..5250c428fc1f 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
@@ -269,6 +269,7 @@ v9fs_session_init(struct v9fs_session_info *v9ses, | |||
269 | int n = 0; | 269 | int n = 0; |
270 | int newfid = -1; | 270 | int newfid = -1; |
271 | int retval = -EINVAL; | 271 | int retval = -EINVAL; |
272 | struct v9fs_str *version; | ||
272 | 273 | ||
273 | v9ses->name = __getname(); | 274 | v9ses->name = __getname(); |
274 | if (!v9ses->name) | 275 | if (!v9ses->name) |
@@ -351,13 +352,16 @@ v9fs_session_init(struct v9fs_session_info *v9ses, | |||
351 | goto FreeFcall; | 352 | goto FreeFcall; |
352 | } | 353 | } |
353 | 354 | ||
354 | /* Really should check for 9P1 and report error */ | 355 | version = &fcall->params.rversion.version; |
355 | if (!v9fs_str_compare("9P2000.u", &fcall->params.rversion.version)) { | 356 | if (version->len==8 && !memcmp(version->str, "9P2000.u", 8)) { |
356 | dprintk(DEBUG_9P, "9P2000 UNIX extensions enabled\n"); | 357 | dprintk(DEBUG_9P, "9P2000 UNIX extensions enabled\n"); |
357 | v9ses->extended = 1; | 358 | v9ses->extended = 1; |
358 | } else { | 359 | } else if (version->len==6 && !memcmp(version->str, "9P2000", 6)) { |
359 | dprintk(DEBUG_9P, "9P2000 legacy mode enabled\n"); | 360 | dprintk(DEBUG_9P, "9P2000 legacy mode enabled\n"); |
360 | v9ses->extended = 0; | 361 | v9ses->extended = 0; |
362 | } else { | ||
363 | retval = -EREMOTEIO; | ||
364 | goto FreeFcall; | ||
361 | } | 365 | } |
362 | 366 | ||
363 | n = fcall->params.rversion.msize; | 367 | n = fcall->params.rversion.msize; |
@@ -449,12 +453,17 @@ extern int v9fs_error_init(void); | |||
449 | 453 | ||
450 | static int __init init_v9fs(void) | 454 | static int __init init_v9fs(void) |
451 | { | 455 | { |
456 | int ret; | ||
457 | |||
452 | v9fs_error_init(); | 458 | v9fs_error_init(); |
453 | 459 | ||
454 | printk(KERN_INFO "Installing v9fs 9P2000 file system support\n"); | 460 | printk(KERN_INFO "Installing v9fs 9P2000 file system support\n"); |
455 | 461 | ||
456 | v9fs_mux_global_init(); | 462 | ret = v9fs_mux_global_init(); |
457 | return register_filesystem(&v9fs_fs_type); | 463 | if (!ret) |
464 | ret = register_filesystem(&v9fs_fs_type); | ||
465 | |||
466 | return ret; | ||
458 | } | 467 | } |
459 | 468 | ||
460 | /** | 469 | /** |