diff options
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 | /** |