kernel: don't auto attach ubi on read error
authorMathias Kresin <dev@kresin.me>
Sun, 8 Jul 2018 21:18:15 +0000 (23:18 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 08:50:54 +0000 (09:50 +0100)
commit031d5cf248490b1e5aedac63ac8ac3c49932912f
treee72bf8fb96d2c41373c6b30c5bb5286b0be12533
parente6945262642a3c83c4f9593286e0c7b794c211f0
kernel: don't auto attach ubi on read error

With a10a204aab26cc ("kernel: make ubi auto-attach check for a tar file
magic") the check for the magic was added without considering a failing
mtd_read(). If the read fails, no check is done and the mount code is
called straight away.

Failing with an error message for such cases seems to me the cleaner way,
as it would allow to spot hidden/workaround issues.

Signed-off-by: Mathias Kresin <dev@kresin.me>
(backported from 3716b5e4e6374883c80e61021923733b14cdb011)
(rebased patches)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch
target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch