autofs: add WARN_ON(1) for non dir/link inode case
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 10 Sep 2016 10:34:23 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:23 +0000 (20:34 +1000)
It's invalid if the given mode is neither dir nor link, so warn on else
case.

Link: http://lkml.kernel.org/r/20160812024754.12352.8536.stgit@pluto.themaw.net
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/autofs4/inode.c

index 64d721f896827d915c7c5421dccfd6d26a6ea403..0dd4db92c214a2162890ac3ebf26045576ec3d69 100644 (file)
@@ -368,7 +368,8 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode)
                inode->i_fop = &autofs4_dir_operations;
        } else if (S_ISLNK(mode)) {
                inode->i_op = &autofs4_symlink_inode_operations;
-       }
+       } else
+               WARN_ON(1);
 
        return inode;
 }
This page took 0.025755 seconds and 5 git commands to generate.