提交 7b81ce7c 编写于 作者: B Barret Rhoden 提交者: Linus Torvalds

init: fix error check in clean_path()

init_stat() returns 0 on success, same as vfs_lstat().  When it replaced
vfs_lstat(), the '!' was dropped.

Fixes: 716308a5 ("init: add an init_stat helper")
Signed-off-by: NBarret Rhoden <brho@google.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 59126901
......@@ -297,7 +297,7 @@ static void __init clean_path(char *path, umode_t fmode)
{
struct kstat st;
if (init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
if (!init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
(st.mode ^ fmode) & S_IFMT) {
if (S_ISDIR(st.mode))
init_rmdir(path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册