mtdblock: Warn if added for a NAND device
authorEzequiel Garcia <ezequiel@collabora.com>
Sun, 1 Aug 2021 23:45:09 +0000 (20:45 -0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 17 Aug 2021 16:41:59 +0000 (18:41 +0200)
commite07403a8c6be01857ff75060b2df9a1aa8320fe5
treed0077382f813b09639ce3ae9f326b1ad61d2a6b4
parent42ba8c3b426342b39341e1b7a97f2387821bff86
mtdblock: Warn if added for a NAND device

There is a surprisingly large number of tutorials
that suggest using mtdblock to mount SquashFS filesystems
on flash devices, including NAND devices.

This approach is suboptimal than using UBI. If the flash device
is NAND, this is specially true, due to wear leveling, bit-flips and
badblocks. In this case UBI is strongly preferred, so be nice to users
and print a warning suggesting to consider UBI block, if mtdblock
is added for a NAND device.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210801234509.18774-8-ezequiel@collabora.com
drivers/mtd/mtdblock.c
drivers/mtd/mtdblock_ro.c