mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 033/102] autofs: add WARN_ON(1) for non dir/link inode case
@ 2016-10-11 20:52 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-10-11 20:52 UTC (permalink / raw)
  To: torvalds, mm-commits, akpm, kusumi.tomohiro, raven

From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Subject: 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>
---

 fs/autofs4/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/autofs4/inode.c~autofs-add-warn_on1-for-non-dir-link-inode-case fs/autofs4/inode.c
--- a/fs/autofs4/inode.c~autofs-add-warn_on1-for-non-dir-link-inode-case
+++ a/fs/autofs4/inode.c
@@ -368,7 +368,8 @@ struct inode *autofs4_get_inode(struct s
 		inode->i_fop = &autofs4_dir_operations;
 	} else if (S_ISLNK(mode)) {
 		inode->i_op = &autofs4_symlink_inode_operations;
-	}
+	} else
+		WARN_ON(1);
 
 	return inode;
 }
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-11 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 20:52 [patch 033/102] autofs: add WARN_ON(1) for non dir/link inode case akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).