From: Barret Rhoden Date: Fri, 4 Sep 2020 13:53:32 +0000 (-0400) Subject: init: fix error check in clean_path() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7b81ce7cdcef3a3ae71eb3fb863433c646b4a2f4;p=linux.git 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: 716308a5331b ("init: add an init_stat helper") Signed-off-by: Barret Rhoden Reviewed-by: Christoph Hellwig Signed-off-by: Linus Torvalds --- diff --git a/init/initramfs.c b/init/initramfs.c index e6dbfb767057d..1f97c0328a7ae 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -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);