projects/linux·commit 7b81ce7c

init: fix error check in clean_path()

7b81ce7c · Barret Rhoden <[email protected]> · 2020-09-04 09:53:32 -04:00

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 <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
7b81ce7cdcef3a3ae71eb3fb863433c646b4a2f4
Parents
59126901

Changes

1 files changed · +1 −1

FileStatusAddDelContent
init/initramfs.cmodified+1−1View file

init/initramfs.c

View file
diff --git a/init/initramfs.c b/init/initramfs.c
index e6dbfb7..1f97c03 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);