From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: [PATCH 05/18] autofs: Add WARN_ON(1) for non dir/link inode case From: Ian Kent To: Andrew Morton Cc: linux-fsdevel , Tomohiro Kusumi , autofs mailing list , Kernel Mailing List Date: Fri, 12 Aug 2016 10:47:54 +0800 Message-ID: <20160812024754.12352.8536.stgit@pluto.themaw.net> In-Reply-To: <20160812024734.12352.17122.stgit@pluto.themaw.net> References: <20160812024734.12352.17122.stgit@pluto.themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Tomohiro Kusumi It's invalid if the given mode is neither dir nor link, so warn on else case. Signed-off-by: Tomohiro Kusumi Signed-off-by: Ian Kent --- fs/autofs4/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 64d721f..0dd4db9 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; }