Re: Invalid pstore_blk use?
From: Kees Cook
Date: Wed Dec 07 2022 - 17:13:57 EST
On Fri, Nov 18, 2022 at 03:41:44PM -0500, Kamal Dasu wrote:
> Kees,
>
> I am in the process of implementing mmcpstore backend for mmc based
> on the mtdpstore driver
>
> This is what is registered with register_pstore_device(&cxt->dev);
> cxt->dev.flags = PSTORE_FLAGS_DMESG;
> cxt->dev.zone.read = mmcpstore_read;
> cxt->dev.zone.write = mmcpstore_write;
> cxt->dev.zone.erase = mmcpstore_erase;
> cxt->dev.zone.panic_write = mmcpstore_panic_write;
>
> # dmesg | grep pstor
> [ 0.000000] Kernel command line: pstore_blk.blkdev=/dev/mmcblk1p8
> crash_kexec_post_notifiers printk.always_kmsg_dump
> [ 1.993986] pstore_zone: registered pstore_blk as backend for
> kmsg(Oops,panic_write) pmsg
> [ 2.002582] pstore: Using crash dump compression: deflate
> [ 2.008133] pstore: Registered pstore_blk as persistent store backend
> [ 2.020907] mmcpstore: /dev/mmcblk1p8 size 131072 start sector
> 34468 registered as psblk backend
> [ 17.868753] psz_kmsg_recover_meta: pstore_zone: no valid data in
> kmsg dump zone 0
> [ 18.298933] psz_recover_zone: pstore_zone: no valid data in zone pmsg
> [ 18.305398] psz_recovery: pstore_zone: recover end!
>
> The driver is successfully registered and the read path works when
> /sys/fs/pstor is mounted , however mmc_pstore_panic_write is not
> called.
> Need help in understanding what could be missing. I am using the
> latest upstream kernel for testing.
Hi!
Can you send an RFC patch? I'd expect this to work as you've currently
described it, but without code I'd just be guessing. :)
-Kees
--
Kees Cook