summaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-22 11:15:40 +0200
committerChristoph Hellwig <hch@lst.de>2020-07-31 08:17:54 +0200
commit716308a5331bf907b819f9db8dc942b19568f925 (patch)
tree9138128e16cab1d49d2006f8340425532c6f9e5d /init/initramfs.c
parent5fee64fcde0770c41e926ff981022eaa512d8980 (diff)
downloadlinux-716308a5331bf907b819f9db8dc942b19568f925.tar.bz2
init: add an init_stat helper
Add a simple helper to stat with a kernel space file name and switch the early init code over to it. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c3
1 files changed, 2 insertions, 1 deletions
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