From: Gagan Sidhu <broly@mac.com>
To: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: Daniel Golle <daniel@makrotopia.org>,
Richard Weinberger <richard@nod.at>,
ZhaoLong Wang <wangzhaolong1@huawei.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mtd <linux-mtd@lists.infradead.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
yangerkun <yangerkun@huawei.com>, yi zhang <yi.zhang@huawei.com>
Subject: Re: [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier
Date: Thu, 20 Jun 2024 16:06:11 -0600 [thread overview]
Message-ID: <EFEC7C06-A3B2-46D6-99F4-ADA7F7199188@mac.com> (raw)
In-Reply-To: <251ae039-9f46-081b-a7ee-fe47de268865@huawei.com>
hi zhihao,
so i assume my crude paraphrase is correct? that i may have unintentionally pointed the finger at you, but the real issue is GLUEBI existing with BLOCK on the same volume?
i was just joking about you being a spy by the way. it was post-fix euphoria ;)
master rich, shepherd weinberger, what say ye?
your wisdom and insight would be greatly appreciated as closure and maybe even a patch to reflect the beauty of collaborating over current ;)
Thanks,
Gagan
> On Jun 17, 2024, at 10:03 PM, Zhihao Cheng <chengzhihao1@huawei.com> wrote:
>
> 在 2024/6/18 6:13, Gagan Sidhu 写道:
> Hi,
>> spoke to a user, gave him a build without MTD_GLUEBI, restoring changes made by (HAHAHA you are! huawei), it booted fine.
>
> May I have the layers' information about mtd/ubi, you can get it by 'mtdinfo -a' and 'ubinfo -a' after booting the device.
> I guess your device boots from ubiblock0_0. There are two ways loading booting device:
> 1. mtd(nand)
> ubi(holds volume ubi0_0)
> mtd12 (gluebi)
> mtdblock12 (This way is cut by this patch, so mtdblock12 is not generated, just like Daniel&Richard analyzed)
> 2. mtd(nand)
> ubi(holds volume ubi0_0)
> ubiblock0_0
>
>> so we need to think about either deprecating GLUEBI or setting an option in the Kconfig that ensures they are mutually exclusive.
>> gluebi is definitely highjacking the block device created by UBI_BLOCK and adding the MTD_UBIVOLUME flag to it.
>
> The gluebi(mtd) and ubiblock could exist on the same UBI volume at the same time, but they cannot be opened at the same time. Here is an example I tested on the local machine:
>
> ↗ ubiblock0_0
> mtd0(nandsim) -> ubi0 (holds volume ubi0_0)
> ↘ gluebi(mtd1)
>
> [root@localhost ~]# ubinfo -a
> UBI version: 1
> Count of UBI devices: 1
> UBI control device major/minor: 10:61
> Present UBI devices: ubi0
>
> ubi0
> Volumes count: 1
> Logical eraseblock size: 126976 bytes, 124.0 KiB
> Total amount of logical eraseblocks: 8192 (1040187392 bytes, 992.0 MiB)
> Amount of available logical eraseblocks: 0 (0 bytes)
> Maximum count of volumes 128
> Count of bad physical eraseblocks: 0
> Count of reserved physical eraseblocks: 160
> Current maximum erase counter value: 2
> Minimum input/output unit size: 2048 bytes
> Character device major/minor: 246:0
> Present volumes: 0
>
> Volume ID: 0 (on ubi0)
> Type: dynamic
> Alignment: 1
> Size: 8026 LEBs (1019109376 bytes, 971.8 MiB)
> State: OK
> Name: vol_a
> Character device major/minor: 246:1
> [root@localhost ~]# mtdinfo -a
> Count of MTD devices: 2
> Present MTD devices: mtd0, mtd1
> Sysfs interface supported: yes
>
> mtd0
> Name: NAND simulator partition 0
> Type: nand
> Eraseblock size: 131072 bytes, 128.0 KiB
> Amount of eraseblocks: 8192 (1073741824 bytes, 1024.0 MiB)
> Minimum input/output unit size: 2048 bytes
> Sub-page size: 512 bytes
> OOB size: 64 bytes
> Character device major/minor: 90:0
> Bad blocks are allowed: true
> Device is writable: true
>
> mtd1
> Name: vol_a
> Type: ubi
> Eraseblock size: 126976 bytes, 124.0 KiB
> Amount of eraseblocks: 8026 (1019109376 bytes, 971.8 MiB)
> Minimum input/output unit size: 2048 bytes
> Sub-page size: 2048 bytes
> Character device major/minor: 90:2
> Bad blocks are allowed: false
> Device is writable: true
>
> [root@localhost ~]# lsblk | grep ubi
> ubiblock0_0 251:0 0 971.9M 0 disk
>
>> there is no other explanation.
>> looks like this was an absolutely amazing exchange that even furthered our understanding of wtf is going on.
>> thanks for being a great moderator for MTD rich
>> Thanks,
>> Gagan
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-06-20 22:06 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CFAC276E-E652-40CD-B3D8-563B95E679A8@mac.com>
2024-06-17 14:31 ` [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier Richard Weinberger
2024-06-17 15:42 ` Richard Weinberger
[not found] ` <14779870-BA54-4ABF-8ABF-FF1D23D172A7@mac.com>
2024-06-17 16:00 ` Richard Weinberger
2024-06-17 16:05 ` Gagan Sidhu
2024-06-17 16:52 ` Richard Weinberger
[not found] ` <E3E2C13C-1E52-46F2-BE2D-D2592C3369DB@mac.com>
2024-06-17 17:33 ` Gagan Sidhu
2024-06-17 17:48 ` Gagan Sidhu
2024-06-17 18:09 ` Richard Weinberger
2024-06-17 18:18 ` Gagan Sidhu
2024-06-17 18:32 ` Richard Weinberger
2024-06-17 18:46 ` Gagan Sidhu
2024-06-17 18:52 ` Richard Weinberger
2024-06-17 20:29 ` Daniel Golle
2024-06-17 21:22 ` Gagan Sidhu
2024-06-17 22:13 ` Gagan Sidhu
2024-06-18 4:03 ` Zhihao Cheng
2024-06-20 22:06 ` Gagan Sidhu [this message]
2024-06-21 1:59 ` Zhihao Cheng
2024-06-21 2:09 ` Gagan Sidhu
2024-06-21 3:03 ` Zhihao Cheng
2024-06-21 4:27 ` Gagan Sidhu
2024-06-21 4:55 ` Zhihao Cheng
2024-06-21 11:36 ` Gagan Sidhu
2024-06-22 2:37 ` Zhihao Cheng
2024-06-22 2:43 ` Gagan Sidhu
2024-06-22 21:07 ` Daniel Golle
2024-06-24 19:00 ` Gagan Sidhu
2023-10-18 12:16 ZhaoLong Wang
2023-10-19 1:57 ` Zhihao Cheng
2023-10-19 20:27 ` Richard Weinberger
2023-10-20 2:27 ` Zhihao Cheng
2023-10-21 16:09 ` Richard Weinberger
2023-10-23 6:41 ` ZhaoLong Wang
2023-10-23 6:46 ` Richard Weinberger
2023-10-23 7:12 ` ZhaoLong Wang
2023-10-23 7:16 ` Richard Weinberger
2023-10-23 7:09 ` Zhihao Cheng
2023-10-23 7:15 ` Richard Weinberger
2023-10-23 7:36 ` Zhihao Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EFEC7C06-A3B2-46D6-99F4-ADA7F7199188@mac.com \
--to=broly@mac.com \
--cc=chengzhihao1@huawei.com \
--cc=daniel@makrotopia.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=wangzhaolong1@huawei.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox