[PATCH 1/3] initramfs: remove clean_rootfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no point in trying to clean up after unpacking the initramfs
failed, as it should never get past the magic number check.  In addition
d_genocide is actually the wrong thing to do here, it should have been
simple_recursive_remove().

Fixes: 38d014f6d446 ("initramfs: simplify clean_rootfs")
Reported-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 init/initramfs.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index 3823d15e5d2619..50ec7e3c5389aa 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -576,16 +576,6 @@ static inline bool kexec_free_initrd(void)
 #endif /* CONFIG_KEXEC_CORE */
 
 #ifdef CONFIG_BLK_DEV_RAM
-static void __init clean_rootfs(void)
-{
-	struct path path;
-
-	if (kern_path("/", 0, &path))
-		return;
-	d_genocide(path.dentry);
-	path_put(&path);
-}
-
 static void __init populate_initrd_image(char *err)
 {
 	ssize_t written;
@@ -625,7 +615,6 @@ static int __init populate_rootfs(void)
 	err = unpack_to_rootfs((char *)initrd_start, initrd_end - initrd_start);
 	if (err) {
 #ifdef CONFIG_BLK_DEV_RAM
-		clean_rootfs();
 		populate_initrd_image(err);
 #else
 		printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
-- 
2.27.0




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux