Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#6548 closed defect (fixed)

300-block2mtd_init.patch breaks md raid array autodetection on x86

Reported by: Pieter "Fate" Hollants <pieter@…> Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: md software raid autodetect autodetection rootfs block2mtd Cc:


--- Short: ---

md (Software RAID) raid array autodetection is broken since 300_block2mtd_init.patch was copied from olpc into x86's patches-2.6.31 directory due to rootfs being not setup beforehand.

--- Long: ---

In init/main.c's kernel_init(), init/do_mounts_md.c's md_run_setup() is called, which attempts a

 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));

This device node is used to trigger the autodetect code in drivers/md/* by issuing a RAID_AUTORUN ioctl() on it.

However, since x86 was lifted to 2.6.31 and 300_block2mtd_init.patch was introduced in r18333, this create_dev() failed with ENOENT.

This happens because 300_block2mtd_init.patch:

  • moves the "*(.initcallrootfs.init)" init call from the INITCALLS #define into a separate INITCALLS_ROOT #define, so the rootfs is no longer initialized in the existing do_initcalls() call in main.c:do_basic_setup().
  • does a separate do_initcalls() for INITCALLS_ROOT _after_ calling md_run_setup(), when it should be the other way, ie. md_run_setup() must run _after_ the rootfs init call was made, because otherwise it can't create /dev/md0 as seen above.

The attached patch reverses the order in 300_block2mtd_init.patch accordingly so that md raid array autodetection works again.

Attachments (1)

openwrt-ticket6548-fix_md_run_setup.patch (396 bytes) - added by Pieter "Fate" Hollants <pieter@…> 8 years ago.
Patch to fix calling order for initcalls and md_run_setup()

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Pieter "Fate" Hollants <pieter@…>

Patch to fix calling order for initcalls and md_run_setup()

comment:1 Changed 8 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r19261

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.