Files read as corrupt when migrating from old kernel (3.0.x) to new kernel (5.2.x).

Steven Clark davolfman at gmail.com
Mon Aug 2 10:48:37 PDT 2021


Hello,

I know posts involving older implementations aren't liked, but I'm not
looking for support to stay on my old kernel.  We're in the process of
upgrading a deployed fleet of ARM embedded systems from an ad-hoc
home-brew-distro with NAND flash based on a 3.0 kernel to a new
Yocto-based distro with a 5.2 kernel.  And we're doing this upgrade
over-the-wire.  The result is we need to perform our upgrade using
only the MTD flash with JFFS2 present on the device.  Despite all odds
we've gotten this to work mostly.

What we've noticed is sometimes files written with the old kernel will
be corrupt or absent when mounted with the new kernel. Usually we can
tweak our procedures to work around this but we haven't been able to
characterize which operations give this problem and which don't other
than jffs2 images written with the old kernel seem to be valid if
unmodified.  We suspect there may have been a change in bad block
recording behavior but we don't know why this would affect reads from
the FS.

Does anyone know any workarounds or hints about the cause that might
help?  Is there a good rule of thumb like switching the kernel as
early as possible?  Is there a userspace tool that might do a
conversion?  We'd like to not have to port forward the old
implementation in an unmaintanable mess if we don't have to.



More information about the linux-mtd mailing list