From: Christoph Hellwig <hch@lst.de>
To: linux-kernel@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-fsdevel@vger.kernel.org,
Marek Szyprowski <m.szyprowski@samsung.com>
Subject: [PATCH 1/3] initramfs: remove clean_rootfs
Date: Mon, 27 Jul 2020 18:07:42 +0200 [thread overview]
Message-ID: <20200727160744.329121-2-hch@lst.de> (raw)
In-Reply-To: <20200727160744.329121-1-hch@lst.de>
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@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
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
next prev parent reply other threads:[~2020-07-27 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 16:07 fixes for: decruft the early init / initrd / initramfs code v2 Christoph Hellwig
2020-07-27 16:07 ` Christoph Hellwig [this message]
2020-07-27 16:07 ` [PATCH 2/3] initramfs: pass a non-f_pos offset to xwrite Christoph Hellwig
2020-07-27 16:07 ` [PATCH 3/3] initd: pass a non-f_pos offset to kernel_read/kernel_write Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200727160744.329121-2-hch@lst.de \
--to=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).