Skip to content

Commit

Permalink
initrd: remove the BLKFLSBUF call in handle_initrd
Browse files Browse the repository at this point in the history
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 ff26956
("brd: remove support for BLKFLSBUF"), so this call is entirely
pointless now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Hellwig committed Jul 30, 2020
1 parent c837699 commit 899ac10
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions init/do_mounts_initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit 899ac10

Please sign in to comment.