diff options
author | Christoph Hellwig <hch@lst.de> | 2020-07-22 12:15:40 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-31 09:17:54 +0300 |
commit | 716308a5331bf907b819f9db8dc942b19568f925 (patch) | |
tree | 9138128e16cab1d49d2006f8340425532c6f9e5d /init/initramfs.c | |
parent | 5fee64fcde0770c41e926ff981022eaa512d8980 (diff) | |
download | linux-716308a5331bf907b819f9db8dc942b19568f925.tar.xz |
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.c | 3 |
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 |