]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/dev-ioctl.c
Merge branch 'topic/snd_card_new-err' into topic/atmel
[linux-2.6-omap-h63xx.git] / fs / autofs4 / dev-ioctl.c
index 0566ff8db4cd711f9b84b151dd95b23e82c19519..025e105bffea984495c1861aa00e731d979b6c4a 100644 (file)
@@ -124,7 +124,7 @@ static inline void free_dev_ioctl(struct autofs_dev_ioctl *param)
 
 /*
  * Check sanity of parameter control fields and if a path is present
- * check that it has a "/" and is terminated.
+ * check that it is terminated and contains at least one "/".
  */
 static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
 {
@@ -138,15 +138,16 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
        }
 
        if (param->size > sizeof(*param)) {
-               err = check_name(param->path);
+               err = invalid_str(param->path,
+                                (void *) ((size_t) param + param->size));
                if (err) {
-                       AUTOFS_WARN("invalid path supplied for cmd(0x%08x)",
-                                   cmd);
+                       AUTOFS_WARN(
+                         "path string terminator missing for cmd(0x%08x)",
+                         cmd);
                        goto out;
                }
 
-               err = invalid_str(param->path,
-                                (void *) ((size_t) param + param->size));
+               err = check_name(param->path);
                if (err) {
                        AUTOFS_WARN("invalid path supplied for cmd(0x%08x)",
                                    cmd);
@@ -532,7 +533,7 @@ static int autofs_dev_ioctl_expire(struct file *fp,
        how = param->expire.how;
        mnt = fp->f_path.mnt;
 
-       if (sbi->type & AUTOFS_TYPE_TRIGGER)
+       if (autofs_type_trigger(sbi->type))
                dentry = autofs4_expire_direct(sbi->sb, mnt, sbi, how);
        else
                dentry = autofs4_expire_indirect(sbi->sb, mnt, sbi, how);
@@ -615,7 +616,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
        param->ismountpoint.out.magic = magic = 0;
 
        if (!fp || param->ioctlfd == -1) {
-               if (type == AUTOFS_TYPE_ANY) {
+               if (autofs_type_any(type)) {
                        struct super_block *sb;
 
                        err = path_lookup(path, LOOKUP_FOLLOW, &nd);