All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Gagan Sidhu <broly@mac.com>
Cc: ZhaoLong Wang <wangzhaolong1@huawei.com>,
	 chengzhihao1 <chengzhihao1@huawei.com>,
	 dpervushin <dpervushin@embeddedalley.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>,
	 daniel@makrotopia.org
Subject: Re: [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier
Date: Mon, 17 Jun 2024 20:52:55 +0200 (CEST)	[thread overview]
Message-ID: <136290141.252319.1718650375432.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <3841F21D-CA54-456C-9D9C-F06EEA332A30@mac.com>

[CC'ing Daniel]

----- Ursprüngliche Mail -----
> Von: "Gagan Sidhu" <broly@mac.com>
> An: "richard" <richard@nod.at>
> CC: "ZhaoLong Wang" <wangzhaolong1@huawei.com>, "chengzhihao1" <chengzhihao1@huawei.com>, "dpervushin"
> <dpervushin@embeddedalley.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>
> Gesendet: Montag, 17. Juni 2024 20:46:10
> Betreff: Re: [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier

>> On Jun 17, 2024, at 12:32 PM, Richard Weinberger <richard@nod.at> wrote:
>> 
>> ----- Ursprüngliche Mail -----
>>> Von: "Gagan Sidhu" <broly@mac.com>
>>>> AFAICT, this log line is not part of the mainline kernel.
>>> 
>>> this is mainline. it’s just not 6.x. it’s 4.14.
>> 
>> I've double checked and disagree.
>> This line comes from:
>> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch;h=6cddaf01b75cb58cfb377f568f2c375af87e2f1b;hb=c3bd1321de1e0d814f5cfc4f494f6b2fb1f5133b
> 
> no i know that, that’s the patch i showed you. i meant the rest of it is
> mainline. the patch obviously is not.
>> 
>> In recent OpenWRT kernels I see:
>> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/pending-5.15/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch;h=266a6331c2acc0f7c17d9ac72f54659d31b56249;hb=HEAD
>> 
>> Looks like in recent versions the patch in question does *not* cause a
>> regression.
> 
> that patch is also applied in my version as well, so i don’t see how this avoids
> the regression.
> 
> https://github.com/torvalds/linux/blob/master/drivers/mtd/mtdcore.c#L774
> 
> mine says "[6.051426] mtd: device 12 (rootfs) set to be root filesystem"
> 
> which is simply the call from drivers/mtd/mtdcore.c
> 
> so the rootfs device is set correctly. it’s just not booting from it.
> 
> the regression comes from having GLUEBI+BLOCK enabled, it seems, are they
> fighting for/operating on the same partition?

I don't know. Let's ask Daniel.

> 
>> 
>>>> (31, 12) would be mtdblock12.
>>>> How does your kernel know that mtdblock12 shall be the rootfs?
>>> 
>>> this is an openwrt approach: https://openwrt.org/docs/techref/filesystems (under
>>> “technical details”, third paragraph)
>>> 
>>> essentially there’s a feature they add to the kernel (via patch) where you can
>>> enable a feature that sets the root device based on the name of the partition.
>> 
>> So, this is all not mainline. :-/
> 
> i did say openwrt at the start, and i think that’s pretty close to mainline as
> it gets.
> 
> sometimes these patches aren’t appropriate to push upstream. this one is not the
> one causing the issue.
> 
> it seems to me that there is a problem with GLUEBI+BLOCK playing together.
> 
> as far as i can see, the setting of the device is being doing by mtdcore.c
> 
> it’s just not working with gluebi and block are enabled, and i need to know
> whether disabling gluebi will allow it to work.
> 
> in other words, is it possible for gluebi to use the partition created by
> ubi_block, and add the MTD_UBIVOLUME flag?

No. UBIBlock works on top of UBI volumes and creates a block device.

We'll sort this out. :)

Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: Gagan Sidhu <broly@mac.com>
Cc: ZhaoLong Wang <wangzhaolong1@huawei.com>,
	 chengzhihao1 <chengzhihao1@huawei.com>,
	 dpervushin <dpervushin@embeddedalley.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>,
	 daniel@makrotopia.org
Subject: Re: [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier
Date: Mon, 17 Jun 2024 20:52:55 +0200 (CEST)	[thread overview]
Message-ID: <136290141.252319.1718650375432.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <3841F21D-CA54-456C-9D9C-F06EEA332A30@mac.com>

[CC'ing Daniel]

----- Ursprüngliche Mail -----
> Von: "Gagan Sidhu" <broly@mac.com>
> An: "richard" <richard@nod.at>
> CC: "ZhaoLong Wang" <wangzhaolong1@huawei.com>, "chengzhihao1" <chengzhihao1@huawei.com>, "dpervushin"
> <dpervushin@embeddedalley.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>
> Gesendet: Montag, 17. Juni 2024 20:46:10
> Betreff: Re: [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier

>> On Jun 17, 2024, at 12:32 PM, Richard Weinberger <richard@nod.at> wrote:
>> 
>> ----- Ursprüngliche Mail -----
>>> Von: "Gagan Sidhu" <broly@mac.com>
>>>> AFAICT, this log line is not part of the mainline kernel.
>>> 
>>> this is mainline. it’s just not 6.x. it’s 4.14.
>> 
>> I've double checked and disagree.
>> This line comes from:
>> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch;h=6cddaf01b75cb58cfb377f568f2c375af87e2f1b;hb=c3bd1321de1e0d814f5cfc4f494f6b2fb1f5133b
> 
> no i know that, that’s the patch i showed you. i meant the rest of it is
> mainline. the patch obviously is not.
>> 
>> In recent OpenWRT kernels I see:
>> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/pending-5.15/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch;h=266a6331c2acc0f7c17d9ac72f54659d31b56249;hb=HEAD
>> 
>> Looks like in recent versions the patch in question does *not* cause a
>> regression.
> 
> that patch is also applied in my version as well, so i don’t see how this avoids
> the regression.
> 
> https://github.com/torvalds/linux/blob/master/drivers/mtd/mtdcore.c#L774
> 
> mine says "[6.051426] mtd: device 12 (rootfs) set to be root filesystem"
> 
> which is simply the call from drivers/mtd/mtdcore.c
> 
> so the rootfs device is set correctly. it’s just not booting from it.
> 
> the regression comes from having GLUEBI+BLOCK enabled, it seems, are they
> fighting for/operating on the same partition?

I don't know. Let's ask Daniel.

> 
>> 
>>>> (31, 12) would be mtdblock12.
>>>> How does your kernel know that mtdblock12 shall be the rootfs?
>>> 
>>> this is an openwrt approach: https://openwrt.org/docs/techref/filesystems (under
>>> “technical details”, third paragraph)
>>> 
>>> essentially there’s a feature they add to the kernel (via patch) where you can
>>> enable a feature that sets the root device based on the name of the partition.
>> 
>> So, this is all not mainline. :-/
> 
> i did say openwrt at the start, and i think that’s pretty close to mainline as
> it gets.
> 
> sometimes these patches aren’t appropriate to push upstream. this one is not the
> one causing the issue.
> 
> it seems to me that there is a problem with GLUEBI+BLOCK playing together.
> 
> as far as i can see, the setting of the device is being doing by mtdcore.c
> 
> it’s just not working with gluebi and block are enabled, and i need to know
> whether disabling gluebi will allow it to work.
> 
> in other words, is it possible for gluebi to use the partition created by
> ubi_block, and add the MTD_UBIVOLUME flag?

No. UBIBlock works on top of UBI volumes and creates a block device.

We'll sort this out. :)

Thanks,
//richard

  reply	other threads:[~2024-06-17 18:53 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 14:25 [PATCH v2] ubi: gluebi: Fix NULL pointer dereference caused by ftl notifier Gagan Sidhu
2024-06-17 14:31 ` Richard Weinberger
2024-06-17 14:31   ` Richard Weinberger
2024-06-17 15:42 ` 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:00       ` Richard Weinberger
2024-06-17 16:05       ` Gagan Sidhu
2024-06-17 16:05         ` Gagan Sidhu
2024-06-17 16:52         ` Richard Weinberger
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:33               ` Gagan Sidhu
2024-06-17 17:48               ` Gagan Sidhu
2024-06-17 17:48                 ` Gagan Sidhu
2024-06-17 18:09                 ` Richard Weinberger
2024-06-17 18:09                   ` Richard Weinberger
2024-06-17 18:18                   ` Gagan Sidhu
2024-06-17 18:18                     ` Gagan Sidhu
2024-06-17 18:32                     ` Richard Weinberger
2024-06-17 18:32                       ` Richard Weinberger
2024-06-17 18:46                       ` Gagan Sidhu
2024-06-17 18:46                         ` Gagan Sidhu
2024-06-17 18:52                         ` Richard Weinberger [this message]
2024-06-17 18:52                           ` Richard Weinberger
2024-06-17 20:29                           ` Daniel Golle
2024-06-17 20:29                             ` Daniel Golle
2024-06-17 21:22                             ` Gagan Sidhu
2024-06-17 21:22                               ` Gagan Sidhu
2024-06-17 22:13                               ` Gagan Sidhu
2024-06-17 22:13                                 ` Gagan Sidhu
2024-06-18  4:03                                 ` Zhihao Cheng
2024-06-18  4:03                                   ` Zhihao Cheng
2024-06-20 22:06                                   ` Gagan Sidhu
2024-06-20 22:06                                     ` Gagan Sidhu
2024-06-21  1:59                                     ` Zhihao Cheng
2024-06-21  1:59                                       ` Zhihao Cheng
2024-06-21  2:09                                       ` Gagan Sidhu
2024-06-21  2:09                                         ` Gagan Sidhu
2024-06-21  3:03                                         ` Zhihao Cheng
2024-06-21  3:03                                           ` Zhihao Cheng
2024-06-21  4:27                                           ` Gagan Sidhu
2024-06-21  4:27                                             ` Gagan Sidhu
2024-06-21  4:55                                             ` Zhihao Cheng
2024-06-21  4:55                                               ` Zhihao Cheng
2024-06-21 11:36                                               ` Gagan Sidhu
2024-06-21 11:36                                                 ` Gagan Sidhu
2024-06-22  2:37                                                 ` Zhihao Cheng
2024-06-22  2:37                                                   ` Zhihao Cheng
2024-06-22  2:43                                                   ` Gagan Sidhu
2024-06-22  2:43                                                     ` Gagan Sidhu
2024-06-22 21:07                                                     ` Daniel Golle
2024-06-22 21:07                                                       ` Daniel Golle
2024-06-24 19:00                                                       ` Gagan Sidhu
2024-06-24 19:00                                                         ` Gagan Sidhu
  -- strict thread matches above, loose matches on Subject: below --
2024-06-17 14:21 Gagan Sidhu
2023-10-18 12:16 ZhaoLong Wang
2023-10-18 12:16 ` ZhaoLong Wang
2023-10-19  1:57 ` Zhihao Cheng
2023-10-19  1:57   ` Zhihao Cheng
2023-10-19 20:27 ` Richard Weinberger
2023-10-19 20:27   ` Richard Weinberger
2023-10-20  2:27   ` Zhihao Cheng
2023-10-20  2:27     ` Zhihao Cheng
2023-10-21 16:09     ` Richard Weinberger
2023-10-21 16:09       ` Richard Weinberger
2023-10-23  6:41       ` ZhaoLong Wang
2023-10-23  6:41         ` ZhaoLong Wang
2023-10-23  6:46         ` Richard Weinberger
2023-10-23  6:46           ` Richard Weinberger
2023-10-23  7:12           ` ZhaoLong Wang
2023-10-23  7:12             ` ZhaoLong Wang
2023-10-23  7:16             ` Richard Weinberger
2023-10-23  7:16               ` Richard Weinberger
2023-10-23  7:09       ` Zhihao Cheng
2023-10-23  7:09         ` Zhihao Cheng
2023-10-23  7:15         ` Richard Weinberger
2023-10-23  7:15           ` Richard Weinberger
2023-10-23  7:36           ` Zhihao Cheng
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=136290141.252319.1718650375432.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=broly@mac.com \
    --cc=chengzhihao1@huawei.com \
    --cc=daniel@makrotopia.org \
    --cc=dpervushin@embeddedalley.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.