Skip to content

Commit

Permalink
[PATCH] 9p: fix bogus return code checks during initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Van Hensbergen authored and Linus Torvalds committed Jan 26, 2007
1 parent f49d5e6 commit f94b347
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion fs/9p/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ int v9fs_mux_global_init(void)
v9fs_mux_poll_tasks[i].task = NULL;

v9fs_mux_wq = create_workqueue("v9fs");
if (!v9fs_mux_wq)
if (!v9fs_mux_wq) {
printk(KERN_WARNING "v9fs: mux: creating workqueue failed\n");
return -ENOMEM;
}

return 0;
}
Expand Down
11 changes: 8 additions & 3 deletions fs/9p/v9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,19 @@ static int __init init_v9fs(void)

v9fs_error_init();

printk(KERN_INFO "Installing v9fs 9P2000 file system support\n");
printk(KERN_INFO "Installing v9fs 9p2000 file system support\n");

ret = v9fs_mux_global_init();
if (!ret)
if (ret) {
printk(KERN_WARNING "v9fs: starting mux failed\n");
return ret;
}
ret = register_filesystem(&v9fs_fs_type);
if (!ret)
if (ret) {
printk(KERN_WARNING "v9fs: registering file system failed\n");
v9fs_mux_global_exit();
}

return ret;
}

Expand Down

0 comments on commit f94b347

Please sign in to comment.