VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@lst.de> 2020-07-22 11:15:40 +0200 committer: Christoph Hellwig <hch@lst.de> 2020-07-31 08:17:54 +0200 commit: 716308a5331bf907b819f9db8dc942b19568f925 parent: 5fee64fcde0770c41e926ff981022eaa512d8980
Commit Summary:
init: add an init_stat helper
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/init/initramfs.c b/init/initramfs.c
index 425addaf7c69..744e111baba4 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -298,7 +298,8 @@ static void __init clean_path(char *path, umode_t fmode)
 {
 	struct kstat st;
 
-	if (!vfs_lstat(path, &st) && (st.mode ^ fmode) & S_IFMT) {
+	if (init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
+	    (st.mode ^ fmode) & S_IFMT) {
 		if (S_ISDIR(st.mode))
 			init_rmdir(path);
 		else