[PATCH] inotify: check retval in init
authorRobert Love <rml@novell.com>
Mon, 25 Jul 2005 19:17:34 +0000 (15:17 -0400)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Jul 2005 20:37:22 +0000 (13:37 -0700)
Check for (unlikely) errors in the filesystem initialization stuff in
our module_init() function.

Signed-off-by: Robert Love <rml@novell.com>
Signed-off-by: John McCutchan <ttb@tentacle.dhs.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/inotify.c

index 6a0ba2c858e6a4ee471d8e76361fb87210c85f74..cdfff9067149cd8f20b5bef9928a583f51f8fef4 100644 (file)
@@ -1025,8 +1025,15 @@ static struct file_system_type inotify_fs_type = {
  */
 static int __init inotify_setup(void)
 {
-       register_filesystem(&inotify_fs_type);
+       int ret;
+
+       ret = register_filesystem(&inotify_fs_type);
+       if (unlikely(ret))
+               panic("inotify: register_filesystem returned %d!\n", ret);
+
        inotify_mnt = kern_mount(&inotify_fs_type);
+       if (unlikely(PTR_ERR(inotify_mnt)))
+               panic("inotify: kern_mount ret %ld!\n", PTR_ERR(inotify_mnt));
 
        inotify_max_queued_events = 16384;
        inotify_max_user_instances = 128;