[09/16] initrd: remove the BLKFLSBUF call in handle_initrd
diff mbox series

Message ID 20200615125323.930983-10-hch@lst.de
State New
Headers show
Series
  • [01/16] init: remove the bstat helper
Related show

Commit Message

Christoph Hellwig June 15, 2020, 12:53 p.m. UTC
BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole
ramdisk, which was completely different behavior compared to all other
drivers.  But this magic overload got removed in commit ff26956875c2
("brd: remove support for BLKFLSBUF"), so this call is entirely
pointless now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 init/do_mounts_initrd.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

H. Peter Anvin July 3, 2020, 3:40 a.m. UTC | #1
On 2020-06-15 05:53, Christoph Hellwig wrote:
> BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole
> ramdisk, which was completely different behavior compared to all other
> drivers.  But this magic overload got removed in commit ff26956875c2
> ("brd: remove support for BLKFLSBUF"), so this call is entirely
> pointless now.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Does *anyone* use initrd as opposed to initramfs anymore? It would seem
like a good candidate for deprecation/removal.

	-hpa
antlists July 4, 2020, 12:18 a.m. UTC | #2
On 03/07/2020 04:40, H. Peter Anvin wrote:
> On 2020-06-15 05:53, Christoph Hellwig wrote:
>> BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole
>> ramdisk, which was completely different behavior compared to all other
>> drivers.  But this magic overload got removed in commit ff26956875c2
>> ("brd: remove support for BLKFLSBUF"), so this call is entirely
>> pointless now.
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Does *anyone* use initrd as opposed to initramfs anymore? It would seem
> like a good candidate for deprecation/removal.
> 
Reading the gentoo mailing list, it seems there's a fair few people who 
don't use initramfs. I get the impression they don't use initrd either, 
though.

I don't know too much about booting without an initramfs - I switched 
ages ago - so what is possible and what they're actually doing, I don't 
know.

Cheers,
Wol
H. Peter Anvin July 4, 2020, 2:19 a.m. UTC | #3
On July 3, 2020 5:18:48 PM PDT, antlists <antlists@youngman.org.uk> wrote:
>On 03/07/2020 04:40, H. Peter Anvin wrote:
>> On 2020-06-15 05:53, Christoph Hellwig wrote:
>>> BLKFLSBUF used to be overloaded for the ramdisk driver to free the
>whole
>>> ramdisk, which was completely different behavior compared to all
>other
>>> drivers.  But this magic overload got removed in commit ff26956875c2
>>> ("brd: remove support for BLKFLSBUF"), so this call is entirely
>>> pointless now.
>>>
>>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> 
>> Does *anyone* use initrd as opposed to initramfs anymore? It would
>seem
>> like a good candidate for deprecation/removal.
>> 
>Reading the gentoo mailing list, it seems there's a fair few people who
>
>don't use initramfs. I get the impression they don't use initrd either,
>
>though.
>
>I don't know too much about booting without an initramfs - I switched 
>ages ago - so what is possible and what they're actually doing, I don't
>
>know.
>
>Cheers,
>Wol

Not using any init userspace at all is an entirely different issue.
Christoph Hellwig July 7, 2020, 9:03 a.m. UTC | #4
On Thu, Jul 02, 2020 at 08:40:31PM -0700, H. Peter Anvin wrote:
> On 2020-06-15 05:53, Christoph Hellwig wrote:
> > BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole
> > ramdisk, which was completely different behavior compared to all other
> > drivers.  But this magic overload got removed in commit ff26956875c2
> > ("brd: remove support for BLKFLSBUF"), so this call is entirely
> > pointless now.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Does *anyone* use initrd as opposed to initramfs anymore? It would seem
> like a good candidate for deprecation/removal.

I thought about that as well.  I think deprecating it at least is a good
idea and can add a patch doing that to the next version.

Patch
diff mbox series

diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index d72beda824aa79..e4f88e9e1c0839 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -115,21 +115,12 @@  static void __init handle_initrd(void)
 	if (!error)
 		printk("okay\n");
 	else {
-		int fd = ksys_open("/dev/root.old", O_RDWR, 0);
 		if (error == -ENOENT)
 			printk("/initrd does not exist. Ignored.\n");
 		else
 			printk("failed\n");
 		printk(KERN_NOTICE "Unmounting old root\n");
 		ksys_umount("/old", MNT_DETACH);
-		printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
-		if (fd < 0) {
-			error = fd;
-		} else {
-			error = ksys_ioctl(fd, BLKFLSBUF, 0);
-			ksys_close(fd);
-		}
-		printk(!error ? "okay\n" : "failed\n");
 	}
 }