2021-02-23 00:05:39

by John Stultz

[permalink] [raw]
Subject: [REGRESSION] "add a disk_uevent helper" breaks booting Andorid w/ dynamic partitions

Hey all,
After updating to Linus' HEAD today I found my db845c board wouldn't
boot to android with the error below.

I was able to bisect the boot regression down to "block: add a
disk_uevent helper":
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc359d03c7ec1bf3b86d03bafaf6bbb21e6414fd

And have validated that reverting that change seems to get things working again.

I don't really know the dynamic partition DM details well, so any tips
as to what might be going wrong here would be appreciated!

thanks
-john

[ 25.782268] init: [libfs_mgr]Skipping mounting '/dev/block/dm-0'
[ 25.788373] init: [libfs_mgr]Failed to open '/dev/block/dm-0': No
such file or directory
[ 25.796579] init:
[libfs_mgr]__mount(source=/dev/block/dm-0(missing),target=/system,type=ext4)=-1:
No such file or directory
[ 25.807978] init: Failed to mount /system: No such file or directory
[ 25.814466] init: Failed to mount required partitions early ...
[ 25.820757] init: InitFatalReboot: signal 6
[ 25.833635] init: #00 pc 00000000003936a8 /init
(UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+96)
[ 25.844001] init: #01 pc 00000000002f1df0 /init
(android::init::InitFatalReboot(int)+208)
[ 25.852340] init: #02 pc 00000000002f21d8 /init
(android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+32)
[ 25.863211] init: #03 pc 000000000000053c [vdso:0000007f97c34000]
[ 25.869449] init: #04 pc 000000000045ffb0 /init (abort+176)
[ 25.875163] init: #05 pc 00000000002f714c /init
(android::init::InitAborter(char const*)+44)
[ 25.883760] init: #06 pc 000000000034dc98 /init
(android::base::SetAborter(std::__1::function<void (char
const*)>&&)::$_3::__invoke(char const*)+80)
[ 25.897241] init: #07 pc 000000000034d840 /init
(android::base::LogMessage::~LogMessage()+360)
[ 25.906002] init: #08 pc 00000000002e93a8 /init
(android::init::FirstStageMain(int, char**)+6648)
[ 25.915039] init: #09 pc 000000000045ee58 /init
(__real_libc_init(void*, void (*)(), int (*)(int, char**, char**),
structors_array_t const*, bionic_tc)
[ 25.929411] init: Reboot ending, jumping to kernel


2021-02-23 06:34:17

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [REGRESSION] "add a disk_uevent helper" breaks booting Andorid w/ dynamic partitions

Please try the patch below:

---
From 85943345b41ec04f5a9e92dfad85b0fb24e2d2eb Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <[email protected]>
Date: Tue, 23 Feb 2021 07:28:22 +0100
Subject: block: don't skip empty device in in disk_uevent

Restore the previous behavior by using the correct flag for the whole device
("part0").

Fixes: 99dfc43ecbf6 ("block: use ->bi_bdev for bio based I/O accounting")
Reported-by: John Stultz <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index dbb92e24ef65ed..fcc530164b5ab4 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -476,7 +476,7 @@ void disk_uevent(struct gendisk *disk, enum kobject_action action)
struct disk_part_iter piter;
struct block_device *part;

- disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0);
+ disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY_PART0);
while ((part = disk_part_iter_next(&piter)))
kobject_uevent(bdev_kobj(part), action);
disk_part_iter_exit(&piter);
--
2.29.2

2021-02-24 00:47:15

by John Stultz

[permalink] [raw]
Subject: Re: [REGRESSION] "add a disk_uevent helper" breaks booting Andorid w/ dynamic partitions

On Mon, Feb 22, 2021 at 10:31 PM Christoph Hellwig <[email protected]> wrote:
>
> Please try the patch below:
>
> ---
> From 85943345b41ec04f5a9e92dfad85b0fb24e2d2eb Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <[email protected]>
> Date: Tue, 23 Feb 2021 07:28:22 +0100
> Subject: block: don't skip empty device in in disk_uevent
>
> Restore the previous behavior by using the correct flag for the whole device
> ("part0").
>
> Fixes: 99dfc43ecbf6 ("block: use ->bi_bdev for bio based I/O accounting")
> Reported-by: John Stultz <[email protected]>
> Signed-off-by: Christoph Hellwig <[email protected]>

Yes, this seems to fix the problem! Thank you so much!
Tested-by: John Stultz <[email protected]>