Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] 9p: fix bogus return code checks during initialization

There is a simple logic error in init_v9fs - the return code checks are
reversed. This patch fixes the return code and adds some messages to prevent
module initialization from failing silently.

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>

authored by

Eric Van Hensbergen and committed by
Linus Torvalds
f94b3470 f49d5e62

+11 -4
+3 -1
fs/9p/mux.c
··· 132 132 v9fs_mux_poll_tasks[i].task = NULL; 133 133 134 134 v9fs_mux_wq = create_workqueue("v9fs"); 135 - if (!v9fs_mux_wq) 135 + if (!v9fs_mux_wq) { 136 + printk(KERN_WARNING "v9fs: mux: creating workqueue failed\n"); 136 137 return -ENOMEM; 138 + } 137 139 138 140 return 0; 139 141 }
+8 -3
fs/9p/v9fs.c
··· 457 457 458 458 v9fs_error_init(); 459 459 460 - printk(KERN_INFO "Installing v9fs 9P2000 file system support\n"); 460 + printk(KERN_INFO "Installing v9fs 9p2000 file system support\n"); 461 461 462 462 ret = v9fs_mux_global_init(); 463 - if (!ret) 463 + if (ret) { 464 + printk(KERN_WARNING "v9fs: starting mux failed\n"); 464 465 return ret; 466 + } 465 467 ret = register_filesystem(&v9fs_fs_type); 466 - if (!ret) 468 + if (ret) { 469 + printk(KERN_WARNING "v9fs: registering file system failed\n"); 467 470 v9fs_mux_global_exit(); 471 + } 472 + 468 473 return ret; 469 474 } 470 475