]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: don't croak on null dev_name
authorSage Weil <sage@newdream.net>
Mon, 20 Jul 2009 18:36:23 +0000 (11:36 -0700)
committerSage Weil <sage@newdream.net>
Mon, 20 Jul 2009 18:36:23 +0000 (11:36 -0700)
As currently caused by bad mount.ceph (mount -t ceph foo:bar mnt).

src/kernel/super.c

index a3cccf3ef968e6ede21d64b66bc1294349787b7c..46e33dddba127bd444e77a13380c4037aaeecaaa 100644 (file)
@@ -492,9 +492,14 @@ static int parse_mount_args(int flags, char *options, const char *dev_name,
        args->max_readdir = 1024;
 
        /* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */
+       if (!dev_name)
+               return -EINVAL;
        c = strstr(dev_name, ":/");
-       if (c == NULL)
+       if (c == NULL) {
+               pr_err("ceph device name is missing path (no :/ in %s)\n",
+                      dev_name);
                return -EINVAL;
+       }
        *c = 0;
 
        /* get mon ip(s) */