android_kernel_xiaomi_sm8350/block
Zhang, Yanmin 561ec68e4d block: fix boot failure with CONFIG_DEBUG_BLOCK_EXT_DEVT=y and nash
We run into system boot failure with kernel 2.6.28-rc. We found it on a
couple of machines, including T61 notebook, nehalem machine, and another
HPC NX6325 notebook.  All the machines use FedoraCore 8 or FedoraCore 9.
With kernel prior to 2.6.28-rc, system boot doesn't fail.

I debug it and locate the root cause. Pls. see
http://bugzilla.kernel.org/show_bug.cgi?id=11899
https://bugzilla.redhat.com/show_bug.cgi?id=471517

As a matter of fact, there are 2 bugs.

1)root=/dev/sda1, system boot randomly fails. Mostly, boot for 5 times
and fails once. nash has a bug. Some of its functions misuse return
value 0.  Sometimes, 0 means timeout and no uevent available. Sometimes,
0 means nash gets an uevent, but the uevent isn't block-related (for
exmaple, usb). If by coincidence, kernel tells nash that uevents are
available, but kernel also set timeout, nash might stops collecting
other uevents in queue if current uevent isn't block-related.  I work
out a patch for nash to fix it.
http://bugzilla.kernel.org/attachment.cgi?id=18858

2) root=LABEL=/, system always can't boot. initrd init reports
switchroot fails. Here is an executation branch of nash when booting:
    (1) nash read /sys/block/sda/dev; Assume major is 8 (on my desktop)
    (2) nash query /proc/devices with the major number; It found line
	"8 sd";
    (3) nash use 'sd' to search its own probe table to find device (DISK)
	type for the device and add it to its own list;
    (4) Later on, it probes all devices in its list to get filesystem
	labels; scsi register "8 sd" always.

When major is 259, nash fails to find the device(DISK) type. I enables
CONFIG_DEBUG_BLOCK_EXT_DEVT=y when compiling kernel, so 259 is picked up
for device /dev/sda1, which causes nash to fail to find device (DISK)
type.

To fixing issue 2), I create a patch for nash and another patch for
kernel.

http://bugzilla.kernel.org/attachment.cgi?id=18859
http://bugzilla.kernel.org/attachment.cgi?id=18837

Below is the patch for kernel 2.6.28-rc4. It registers blkext, a new
block device in proc/devices.

With 2 patches on nash and 1 patch on kernel, I boot my machines for
dozens of times without failure.

Signed-off-by Zhang Yanmin <yanmin.zhang@linux.intel.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-11-18 15:08:56 +01:00
..
as-iosched.c block: as/cfq ssd idle check update 2008-10-09 08:56:19 +02:00
blk-barrier.c block: adjust blkdev_issue_discard for swap 2008-10-09 08:56:17 +02:00
blk-core.c blk: move blk_delete_timer call in end_that_request_last 2008-11-06 08:41:56 +01:00
blk-exec.c Add some block/ source files to the kernel-api docbook. Fix kernel-doc notation in them as needed. Fix changed function parameter names. Fix typos/spellos. In comments, change REQ_SPECIAL to REQ_TYPE_SPECIAL and REQ_BLOCK_PC to REQ_TYPE_BLOCK_PC. 2008-10-09 08:56:03 +02:00
blk-integrity.c block: Switch blk_integrity_compare from bdev to gendisk 2008-10-09 08:56:21 +02:00
blk-ioc.c cfq-iosched: fix RCU race in the cfq io_context destructor handling 2008-05-07 09:28:57 +02:00
blk-map.c block: make blk_rq_map_user take a NULL user-space buffer 2008-10-09 08:56:11 +02:00
blk-merge.c block: remove unused ll_new_mergeable() 2008-11-06 08:41:55 +01:00
blk-settings.c block: move q->unplug_work initialization 2008-10-17 08:46:57 +02:00
blk-softirq.c block: add fault injection mechanism for faking request timeouts 2008-10-09 08:56:17 +02:00
blk-sysfs.c block: add support for IO CPU affinity 2008-10-09 08:56:09 +02:00
blk-tag.c block: reserve some tags just for sync IO 2008-10-09 08:56:19 +02:00
blk-timeout.c Block: use round_jiffies_up() 2008-11-06 08:42:49 +01:00
blk.h block: remove __generic_unplug_device() from exports 2008-10-17 14:03:08 +02:00
blktrace.c blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure 2008-10-09 08:56:20 +02:00
bsg.c [PATCH] switch scsi_cmd_ioctl() to passing fmode_t 2008-10-21 07:47:14 -04:00
cfq-iosched.c block: as/cfq ssd idle check update 2008-10-09 08:56:19 +02:00
cmd-filter.c [PATCH] introduce fmode_t, do annotations 2008-10-21 07:47:06 -04:00
compat_ioctl.c compat_blkdev_driver_ioctl: Remove unused variable warning 2008-10-23 10:28:25 -07:00
deadline-iosched.c deadline-iosched: non-functional fixes 2008-10-09 08:56:03 +02:00
elevator.c block: add timer on blkdev_dequeue_request() not elv_next_request() 2008-11-06 08:41:55 +01:00
genhd.c block: fix boot failure with CONFIG_DEBUG_BLOCK_EXT_DEVT=y and nash 2008-11-18 15:08:56 +01:00
ioctl.c block: make add_partition() return pointer to hd_struct 2008-11-18 15:08:56 +01:00
Kconfig block: Block layer data integrity support 2008-07-03 13:21:13 +02:00
Kconfig.iosched
Makefile block: unify request timeout handling 2008-10-09 08:56:13 +02:00
noop-iosched.c
scsi_ioctl.c [PATCH] switch scsi_cmd_ioctl() to passing fmode_t 2008-10-21 07:47:14 -04:00