2020-07-09 15:21:19

by Christoph Hellwig

[permalink] [raw]
Subject: decruft the early init / initrd / initramfs code v2

Hi all,

this series starts to move the early init code away from requiring
KERNEL_DS to be implicitly set during early startup. It does so by
first removing legacy unused cruft, and the switches away the code
from struct file based APIs to our more usual in-kernel APIs.

There is no really good tree for this, so if there are no objections
I'd like to set up a new one for linux-next.


Git tree:

git://git.infradead.org/users/hch/misc.git init-user-pointers

Gitweb:

http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init-user-pointers


Changes since v1:
- add a patch to deprecated "classic" initrd support

Diffstat:
b/arch/arm/kernel/atags_parse.c | 2
b/arch/sh/kernel/setup.c | 2
b/arch/sparc/kernel/setup_32.c | 2
b/arch/sparc/kernel/setup_64.c | 2
b/arch/x86/kernel/setup.c | 2
b/drivers/md/Makefile | 3
b/drivers/md/md-autodetect.c | 239 ++++++++++++++++++----------------------
b/drivers/md/md.c | 34 +----
b/drivers/md/md.h | 10 +
b/fs/file.c | 7 -
b/fs/open.c | 18 +--
b/fs/read_write.c | 2
b/fs/readdir.c | 11 -
b/include/linux/initrd.h | 6 -
b/include/linux/raid/detect.h | 8 +
b/include/linux/syscalls.h | 16 --
b/init/Makefile | 1
b/init/do_mounts.c | 70 +----------
b/init/do_mounts.h | 21 ---
b/init/do_mounts_initrd.c | 13 --
b/init/do_mounts_rd.c | 102 +++++++----------
b/init/initramfs.c | 103 +++++------------
b/init/main.c | 16 +-
include/linux/raid/md_u.h | 13 --
24 files changed, 251 insertions(+), 452 deletions(-)


2020-07-09 15:21:29

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 13/17] initramfs: remove the populate_initrd_image and clean_rootfs stubs

If initrd support is not enable just print the warning directly instead
of hiding the fact that we just failed behind two stub functions.

Signed-off-by: Christoph Hellwig <[email protected]>
---
init/initramfs.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7a38012e1af742..d10404625c31f0 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -618,13 +618,7 @@ static void __init clean_rootfs(void)
ksys_close(fd);
kfree(buf);
}
-#else
-static inline void clean_rootfs(void)
-{
-}
-#endif /* CONFIG_BLK_DEV_RAM */

-#ifdef CONFIG_BLK_DEV_RAM
static void __init populate_initrd_image(char *err)
{
ssize_t written;
@@ -644,11 +638,6 @@ static void __init populate_initrd_image(char *err)
written, initrd_end - initrd_start);
ksys_close(fd);
}
-#else
-static void __init populate_initrd_image(char *err)
-{
- printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
-}
#endif /* CONFIG_BLK_DEV_RAM */

static int __init populate_rootfs(void)
@@ -668,8 +657,12 @@ 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);
+#endif
}

done:
--
2.26.2

2020-07-09 15:23:05

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 07/17] md: rewrite md_setup_drive to avoid ioctls

md_setup_drive knows it works with md devices, so it is rather pointless
to open a file descriptor and issue ioctls. Just call directly into the
relevant low-level md routines after getting a handle to the device using
blkdev_get_by_dev instead.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/md/md-autodetect.c | 127 ++++++++++++++++---------------------
drivers/md/md.c | 20 +++---
drivers/md/md.h | 6 ++
3 files changed, 71 insertions(+), 82 deletions(-)

diff --git a/drivers/md/md-autodetect.c b/drivers/md/md-autodetect.c
index a43a8f1580584c..5b24b5616d3acc 100644
--- a/drivers/md/md-autodetect.c
+++ b/drivers/md/md-autodetect.c
@@ -2,7 +2,6 @@
#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <linux/init.h>
-#include <linux/syscalls.h>
#include <linux/mount.h>
#include <linux/major.h>
#include <linux/delay.h>
@@ -120,37 +119,29 @@ static int __init md_setup(char *str)
return 1;
}

-static inline int create_dev(char *name, dev_t dev)
-{
- ksys_unlink(name);
- return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
-}
-
static void __init md_setup_drive(struct md_setup_args *args)
{
- int minor, i, partitioned;
- dev_t dev;
- dev_t devices[MD_SB_DISKS+1];
- int fd;
- int err = 0;
- char *devname;
- mdu_disk_info_t dinfo;
+ char *devname = args->device_names;
+ dev_t devices[MD_SB_DISKS + 1], mdev;
+ struct mdu_array_info_s ainfo = { };
+ struct block_device *bdev;
+ struct mddev *mddev;
+ int err = 0, i;
char name[16];

- minor = args->minor;
- partitioned = args->partitioned;
- devname = args->device_names;
+ if (args->partitioned) {
+ mdev = MKDEV(mdp_major, args->minor << MdpMinorShift);
+ sprintf(name, "md_d%d", args->minor);
+ } else {
+ mdev = MKDEV(MD_MAJOR, args->minor);
+ sprintf(name, "md%d", args->minor);
+ }

- sprintf(name, "/dev/md%s%d", partitioned?"_d":"", minor);
- if (partitioned)
- dev = MKDEV(mdp_major, minor << MdpMinorShift);
- else
- dev = MKDEV(MD_MAJOR, minor);
- create_dev(name, dev);
for (i = 0; i < MD_SB_DISKS && devname != NULL; i++) {
struct kstat stat;
char *p;
char comp_name[64];
+ dev_t dev;

p = strchr(devname, ',');
if (p)
@@ -163,7 +154,7 @@ static void __init md_setup_drive(struct md_setup_args *args)
if (vfs_stat(comp_name, &stat) == 0 && S_ISBLK(stat.mode))
dev = new_decode_dev(stat.rdev);
if (!dev) {
- printk(KERN_WARNING "md: Unknown device name: %s\n", devname);
+ pr_warn("md: Unknown device name: %s\n", devname);
break;
}

@@ -175,68 +166,64 @@ static void __init md_setup_drive(struct md_setup_args *args)
if (!i)
return;

- printk(KERN_INFO "md: Loading md%s%d: %s\n",
- partitioned ? "_d" : "", minor,
- args->device_names);
+ pr_info("md: Loading %s: %s\n", name, args->device_names);

- fd = ksys_open(name, 0, 0);
- if (fd < 0) {
- printk(KERN_ERR "md: open failed - cannot start "
- "array %s\n", name);
+ bdev = blkdev_get_by_dev(mdev, FMODE_READ, NULL);
+ if (IS_ERR(bdev)) {
+ pr_err("md: open failed - cannot start array %s\n", name);
return;
}
- if (ksys_ioctl(fd, SET_ARRAY_INFO, 0) == -EBUSY) {
- printk(KERN_WARNING
- "md: Ignoring md=%d, already autodetected. (Use raid=noautodetect)\n",
- minor);
- ksys_close(fd);
- return;
+ mddev = bdev->bd_disk->private_data;
+
+ err = mddev_lock(mddev);
+ if (err) {
+ pr_err("md: failed to lock array %s\n", name);
+ goto out_blkdev_put;
+ }
+
+ if (!list_empty(&mddev->disks) || mddev->raid_disks) {
+ pr_warn("md: Ignoring %s, already autodetected. (Use raid=noautodetect)\n",
+ name);
+ goto out_unlock;
}

if (args->level != LEVEL_NONE) {
/* non-persistent */
- mdu_array_info_t ainfo;
ainfo.level = args->level;
- ainfo.size = 0;
- ainfo.nr_disks =0;
- ainfo.raid_disks =0;
- while (devices[ainfo.raid_disks])
- ainfo.raid_disks++;
- ainfo.md_minor =minor;
+ ainfo.md_minor = args->minor;
ainfo.not_persistent = 1;
-
ainfo.state = (1 << MD_SB_CLEAN);
- ainfo.layout = 0;
ainfo.chunk_size = args->chunk;
- err = ksys_ioctl(fd, SET_ARRAY_INFO, (long)&ainfo);
- for (i = 0; !err && i <= MD_SB_DISKS; i++) {
- dev = devices[i];
- if (!dev)
- break;
+ while (devices[ainfo.raid_disks])
+ ainfo.raid_disks++;
+ }
+
+ err = md_set_array_info(mddev, &ainfo);
+
+ for (i = 0; i <= MD_SB_DISKS && devices[i]; i++) {
+ struct mdu_disk_info_s dinfo = {
+ .major = MAJOR(devices[i]),
+ .minor = MINOR(devices[i]),
+ };
+
+ if (args->level != LEVEL_NONE) {
dinfo.number = i;
dinfo.raid_disk = i;
- dinfo.state = (1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC);
- dinfo.major = MAJOR(dev);
- dinfo.minor = MINOR(dev);
- err = ksys_ioctl(fd, ADD_NEW_DISK,
- (long)&dinfo);
- }
- } else {
- /* persistent */
- for (i = 0; i <= MD_SB_DISKS; i++) {
- dev = devices[i];
- if (!dev)
- break;
- dinfo.major = MAJOR(dev);
- dinfo.minor = MINOR(dev);
- ksys_ioctl(fd, ADD_NEW_DISK, (long)&dinfo);
+ dinfo.state =
+ (1 << MD_DISK_ACTIVE) | (1 << MD_DISK_SYNC);
}
+
+ md_add_new_disk(mddev, &dinfo);
}
+
if (!err)
- err = ksys_ioctl(fd, RUN_ARRAY, 0);
+ err = do_md_run(mddev);
if (err)
- printk(KERN_WARNING "md: starting md%d failed\n", minor);
- ksys_close(fd);
+ pr_warn("md: starting %s failed\n", name);
+out_unlock:
+ mddev_unlock(mddev);
+out_blkdev_put:
+ blkdev_put(bdev, FMODE_READ);
}

static int __init raid_setup(char *str)
@@ -286,8 +273,6 @@ void __init md_run_setup(void)
{
int ent;

- create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
-
if (raid_noautodetect)
printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");
else
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6e9a48da474848..9960cfeb59a50c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4368,7 +4368,6 @@ array_state_show(struct mddev *mddev, char *page)

static int do_md_stop(struct mddev *mddev, int ro, struct block_device *bdev);
static int md_set_readonly(struct mddev *mddev, struct block_device *bdev);
-static int do_md_run(struct mddev *mddev);
static int restart_array(struct mddev *mddev);

static ssize_t
@@ -6015,7 +6014,7 @@ int md_run(struct mddev *mddev)
}
EXPORT_SYMBOL_GPL(md_run);

-static int do_md_run(struct mddev *mddev)
+int do_md_run(struct mddev *mddev)
{
int err;

@@ -6651,7 +6650,7 @@ static int get_disk_info(struct mddev *mddev, void __user * arg)
return 0;
}

-static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info)
+int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info)
{
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
struct md_rdev *rdev;
@@ -6697,7 +6696,7 @@ static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info)
}

/*
- * add_new_disk can be used once the array is assembled
+ * md_add_new_disk can be used once the array is assembled
* to add "hot spares". They must already have a superblock
* written
*/
@@ -6810,7 +6809,7 @@ static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info)
return err;
}

- /* otherwise, add_new_disk is only allowed
+ /* otherwise, md_add_new_disk is only allowed
* for major_version==0 superblocks
*/
if (mddev->major_version != 0) {
@@ -7055,7 +7054,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
}

/*
- * set_array_info is used two different ways
+ * md_set_array_info is used two different ways
* The original usage is when creating a new array.
* In this usage, raid_disks is > 0 and it together with
* level, size, not_persistent,layout,chunksize determine the
@@ -7067,9 +7066,8 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
* The minor and patch _version numbers are also kept incase the
* super_block handler wishes to interpret them.
*/
-static int set_array_info(struct mddev *mddev, mdu_array_info_t *info)
+int md_set_array_info(struct mddev *mddev, struct mdu_array_info_s *info)
{
-
if (info->raid_disks == 0) {
/* just setting version number for superblock loading */
if (info->major_version < 0 ||
@@ -7560,7 +7558,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
err = -EBUSY;
goto unlock;
}
- err = set_array_info(mddev, &info);
+ err = md_set_array_info(mddev, &info);
if (err) {
pr_warn("md: couldn't set array info. %d\n", err);
goto unlock;
@@ -7614,7 +7612,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
/* Need to clear read-only for this */
break;
else
- err = add_new_disk(mddev, &info);
+ err = md_add_new_disk(mddev, &info);
goto unlock;
}
break;
@@ -7682,7 +7680,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
if (copy_from_user(&info, argp, sizeof(info)))
err = -EFAULT;
else
- err = add_new_disk(mddev, &info);
+ err = md_add_new_disk(mddev, &info);
goto unlock;
}

diff --git a/drivers/md/md.h b/drivers/md/md.h
index 6f8fff77ce10a5..7ee81aa2eac862 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -801,7 +801,13 @@ static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio
mddev->queue->limits.max_write_zeroes_sectors = 0;
}

+struct mdu_array_info_s;
+struct mdu_disk_info_s;
+
extern int mdp_major;
void md_autostart_arrays(int part);
+int md_set_array_info(struct mddev *mddev, struct mdu_array_info_s *info);
+int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info);
+int do_md_run(struct mddev *mddev);

#endif /* _MD_MD_H */
--
2.26.2

2020-07-09 15:23:14

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 03/17] md: replace the RAID_AUTORUN ioctl with a direct function call

Instead of using a spcial RAID_AUTORUN ioctl that only exists for
non-modular builds and is only called from the early init code, just
call the actual function directly.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/md/md-autodetect.c | 10 ++--------
drivers/md/md.c | 14 +-------------
drivers/md/md.h | 3 +++
3 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/md/md-autodetect.c b/drivers/md/md-autodetect.c
index fe806f7b9759a1..0eb746211ed53c 100644
--- a/drivers/md/md-autodetect.c
+++ b/drivers/md/md-autodetect.c
@@ -9,6 +9,7 @@
#include <linux/raid/detect.h>
#include <linux/raid/md_u.h>
#include <linux/raid/md_p.h>
+#include "md.h"

/*
* When md (and any require personalities) are compiled into the kernel
@@ -285,8 +286,6 @@ __setup("md=", md_setup);

static void __init autodetect_raid(void)
{
- int fd;
-
/*
* Since we don't want to detect and use half a raid array, we need to
* wait for the known devices to complete their probing
@@ -295,12 +294,7 @@ static void __init autodetect_raid(void)
printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");

wait_for_device_probe();
-
- fd = ksys_open("/dev/md0", 0, 0);
- if (fd >= 0) {
- ksys_ioctl(fd, RAID_AUTORUN, raid_autopart);
- ksys_close(fd);
- }
+ md_autostart_arrays(raid_autopart);
}

void __init md_run_setup(void)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f567f536b529bd..6e9a48da474848 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -68,10 +68,6 @@
#include "md-bitmap.h"
#include "md-cluster.h"

-#ifndef MODULE
-static void autostart_arrays(int part);
-#endif
-
/* pers_list is a list of registered personalities protected
* by pers_lock.
* pers_lock does extra service to protect accesses to
@@ -7421,7 +7417,6 @@ static inline bool md_ioctl_valid(unsigned int cmd)
case GET_DISK_INFO:
case HOT_ADD_DISK:
case HOT_REMOVE_DISK:
- case RAID_AUTORUN:
case RAID_VERSION:
case RESTART_ARRAY_RW:
case RUN_ARRAY:
@@ -7467,13 +7462,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
case RAID_VERSION:
err = get_version(argp);
goto out;
-
-#ifndef MODULE
- case RAID_AUTORUN:
- err = 0;
- autostart_arrays(arg);
- goto out;
-#endif
default:;
}

@@ -9721,7 +9709,7 @@ void md_autodetect_dev(dev_t dev)
}
}

-static void autostart_arrays(int part)
+void md_autostart_arrays(int part)
{
struct md_rdev *rdev;
struct detected_devices_node *node_detected_dev;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 612814d07d35ab..37315a3f28e97d 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -800,4 +800,7 @@ static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio
!bio->bi_disk->queue->limits.max_write_zeroes_sectors)
mddev->queue->limits.max_write_zeroes_sectors = 0;
}
+
+void md_autostart_arrays(int part);
+
#endif /* _MD_MD_H */
--
2.26.2

2020-07-09 15:23:48

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 01/17] init: remove the bstat helper

The only caller of the bstat function becomes cleaner and simpler when
open coding the function.

Signed-off-by: Christoph Hellwig <[email protected]>
---
init/do_mounts.h | 10 ----------
init/do_mounts_md.c | 8 ++++----
2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/init/do_mounts.h b/init/do_mounts.h
index 0bb0806de4ce2c..7513d1c14d13fe 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -20,16 +20,6 @@ static inline int create_dev(char *name, dev_t dev)
return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
}

-static inline u32 bstat(char *name)
-{
- struct kstat stat;
- if (vfs_stat(name, &stat) != 0)
- return 0;
- if (!S_ISBLK(stat.mode))
- return 0;
- return stat.rdev;
-}
-
#ifdef CONFIG_BLK_DEV_RAM

int __init rd_load_disk(int n);
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index b84031528dd446..359363e85ccd0b 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -138,9 +138,9 @@ static void __init md_setup_drive(void)
dev = MKDEV(MD_MAJOR, minor);
create_dev(name, dev);
for (i = 0; i < MD_SB_DISKS && devname != NULL; i++) {
+ struct kstat stat;
char *p;
char comp_name[64];
- u32 rdev;

p = strchr(devname, ',');
if (p)
@@ -150,9 +150,9 @@ static void __init md_setup_drive(void)
if (strncmp(devname, "/dev/", 5) == 0)
devname += 5;
snprintf(comp_name, 63, "/dev/%s", devname);
- rdev = bstat(comp_name);
- if (rdev)
- dev = new_decode_dev(rdev);
+ if (vfs_stat(comp_name, &stat) == 0 &&
+ S_ISBLK(stat.mode))
+ dev = new_decode_dev(stat.rdev);
if (!dev) {
printk(KERN_WARNING "md: Unknown device name: %s\n", devname);
break;
--
2.26.2

2020-07-09 18:12:31

by Linus Torvalds

[permalink] [raw]
Subject: Re: decruft the early init / initrd / initramfs code v2

On Thu, Jul 9, 2020 at 8:18 AM Christoph Hellwig <[email protected]> wrote:
>
> There is no really good tree for this, so if there are no objections
> I'd like to set up a new one for linux-next.

All looks good to me. I had a wish-list change for one of the patches
that I sent a reply out for, but even without that it's clearly an
improvement.

Of course, I just looked at the patches for sanity, rather than
testing anything. Maybe there's something stupid in there. But it all
looked straightforward. So Ack from me, with the hope that you'd do
that "vfs_chown/chmod()" thing.

Linus

2020-07-09 23:33:19

by H. Peter Anvin

[permalink] [raw]
Subject: Re: decruft the early init / initrd / initramfs code v2

On July 9, 2020 8:17:57 AM PDT, Christoph Hellwig <[email protected]> wrote:
>Hi all,
>
>this series starts to move the early init code away from requiring
>KERNEL_DS to be implicitly set during early startup. It does so by
>first removing legacy unused cruft, and the switches away the code
>from struct file based APIs to our more usual in-kernel APIs.
>
>There is no really good tree for this, so if there are no objections
>I'd like to set up a new one for linux-next.
>
>
>Git tree:
>
> git://git.infradead.org/users/hch/misc.git init-user-pointers
>
>Gitweb:
>
>http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init-user-pointers
>
>
>Changes since v1:
> - add a patch to deprecated "classic" initrd support
>
>Diffstat:
> b/arch/arm/kernel/atags_parse.c | 2
> b/arch/sh/kernel/setup.c | 2
> b/arch/sparc/kernel/setup_32.c | 2
> b/arch/sparc/kernel/setup_64.c | 2
> b/arch/x86/kernel/setup.c | 2
> b/drivers/md/Makefile | 3
>b/drivers/md/md-autodetect.c | 239
>++++++++++++++++++----------------------
> b/drivers/md/md.c | 34 +----
> b/drivers/md/md.h | 10 +
> b/fs/file.c | 7 -
> b/fs/open.c | 18 +--
> b/fs/read_write.c | 2
> b/fs/readdir.c | 11 -
> b/include/linux/initrd.h | 6 -
> b/include/linux/raid/detect.h | 8 +
> b/include/linux/syscalls.h | 16 --
> b/init/Makefile | 1
> b/init/do_mounts.c | 70 +----------
> b/init/do_mounts.h | 21 ---
> b/init/do_mounts_initrd.c | 13 --
> b/init/do_mounts_rd.c | 102 +++++++----------
> b/init/initramfs.c | 103 +++++------------
> b/init/main.c | 16 +-
> include/linux/raid/md_u.h | 13 --
> 24 files changed, 251 insertions(+), 452 deletions(-)

I guess I could say something here... ;)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

2020-07-14 06:41:43

by Christoph Hellwig

[permalink] [raw]
Subject: Re: decruft the early init / initrd / initramfs code v2

On Thu, Jul 09, 2020 at 04:32:07PM -0700, [email protected] wrote:
> On July 9, 2020 8:17:57 AM PDT, Christoph Hellwig <[email protected]> wrote:
> >Hi all,
> >
> >this series starts to move the early init code away from requiring
> >KERNEL_DS to be implicitly set during early startup. It does so by
> >first removing legacy unused cruft, and the switches away the code
> >from struct file based APIs to our more usual in-kernel APIs.
> >
> >There is no really good tree for this, so if there are no objections
> >I'd like to set up a new one for linux-next.
> >
> >
> >Git tree:
> >
> > git://git.infradead.org/users/hch/misc.git init-user-pointers
> >
> >Gitweb:
> >
> >http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init-user-pointers
> >
> >
> >Changes since v1:
> > - add a patch to deprecated "classic" initrd support
> >
> >Diffstat:
> > b/arch/arm/kernel/atags_parse.c | 2
> > b/arch/sh/kernel/setup.c | 2
> > b/arch/sparc/kernel/setup_32.c | 2
> > b/arch/sparc/kernel/setup_64.c | 2
> > b/arch/x86/kernel/setup.c | 2
> > b/drivers/md/Makefile | 3
> >b/drivers/md/md-autodetect.c | 239
> >++++++++++++++++++----------------------
> > b/drivers/md/md.c | 34 +----
> > b/drivers/md/md.h | 10 +
> > b/fs/file.c | 7 -
> > b/fs/open.c | 18 +--
> > b/fs/read_write.c | 2
> > b/fs/readdir.c | 11 -
> > b/include/linux/initrd.h | 6 -
> > b/include/linux/raid/detect.h | 8 +
> > b/include/linux/syscalls.h | 16 --
> > b/init/Makefile | 1
> > b/init/do_mounts.c | 70 +----------
> > b/init/do_mounts.h | 21 ---
> > b/init/do_mounts_initrd.c | 13 --
> > b/init/do_mounts_rd.c | 102 +++++++----------
> > b/init/initramfs.c | 103 +++++------------
> > b/init/main.c | 16 +-
> > include/linux/raid/md_u.h | 13 --
> > 24 files changed, 251 insertions(+), 452 deletions(-)
>
> I guess I could say something here... ;)

Like adding an ACK? :)

2020-07-14 16:24:02

by Song Liu

[permalink] [raw]
Subject: Re: decruft the early init / initrd / initramfs code v2

On Mon, Jul 13, 2020 at 11:41 PM Christoph Hellwig <[email protected]> wrote:
>
> On Thu, Jul 09, 2020 at 04:32:07PM -0700, [email protected] wrote:
> > On July 9, 2020 8:17:57 AM PDT, Christoph Hellwig <[email protected]> wrote:
> > >Hi all,
> > >
> > >this series starts to move the early init code away from requiring
> > >KERNEL_DS to be implicitly set during early startup. It does so by
> > >first removing legacy unused cruft, and the switches away the code
> > >from struct file based APIs to our more usual in-kernel APIs.
> > >
> > >There is no really good tree for this, so if there are no objections
> > >I'd like to set up a new one for linux-next.
> > >
> > >
> > >Git tree:
> > >
> > > git://git.infradead.org/users/hch/misc.git init-user-pointers
> > >
> > >Gitweb:
> > >
> > >http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/init-user-pointers
> > >
> > >
> > >Changes since v1:
> > > - add a patch to deprecated "classic" initrd support
> > >
> > >Diffstat:
> > > b/arch/arm/kernel/atags_parse.c | 2
> > > b/arch/sh/kernel/setup.c | 2
> > > b/arch/sparc/kernel/setup_32.c | 2
> > > b/arch/sparc/kernel/setup_64.c | 2
> > > b/arch/x86/kernel/setup.c | 2
> > > b/drivers/md/Makefile | 3
> > >b/drivers/md/md-autodetect.c | 239
> > >++++++++++++++++++----------------------
> > > b/drivers/md/md.c | 34 +----
> > > b/drivers/md/md.h | 10 +
> > > b/fs/file.c | 7 -
> > > b/fs/open.c | 18 +--
> > > b/fs/read_write.c | 2
> > > b/fs/readdir.c | 11 -
> > > b/include/linux/initrd.h | 6 -
> > > b/include/linux/raid/detect.h | 8 +
> > > b/include/linux/syscalls.h | 16 --
> > > b/init/Makefile | 1
> > > b/init/do_mounts.c | 70 +----------
> > > b/init/do_mounts.h | 21 ---
> > > b/init/do_mounts_initrd.c | 13 --
> > > b/init/do_mounts_rd.c | 102 +++++++----------
> > > b/init/initramfs.c | 103 +++++------------
> > > b/init/main.c | 16 +-
> > > include/linux/raid/md_u.h | 13 --
> > > 24 files changed, 251 insertions(+), 452 deletions(-)
> >
> > I guess I could say something here... ;)
>
> Like adding an ACK? :)

For the md bits:
Acked-by: Song Liu <[email protected]>

Thanks!