summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>2016-10-11 22:52:36 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-12 00:06:31 +0200
commit97537b35b662855e19f2812d3d716bde6f237cfa (patch)
treed18bb30c752e89af6f6dd764495c68eaae69db19
parentautofs: fix autofs4_fill_super() error exit handling (diff)
downloadlinux-97537b35b662855e19f2812d3d716bde6f237cfa.tar.xz
linux-97537b35b662855e19f2812d3d716bde6f237cfa.zip
autofs: add WARN_ON(1) for non dir/link inode case
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/autofs4/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 3f486c1f5f43..a61521eaf113 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -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;
}