UBI/UBIFS: mount fails after volume truncate

Juha Kuikka juha.kuikka at gmail.com
Wed Apr 22 00:15:04 PDT 2015


Hi,

I ran into a weird thing today and I am not sure if this is expected
behavior in my use case or an error:

1. Truncate volume (UBI_IOCVOLUP with zero size)
2. Reboot system few seconds after
3. After reboot try to mount the truncated volume

Mount will fail with UBIFS complaining it cannot find a node in LEB
zero (expected 6, got 255 for id). the message also indicates that the
LEB is mapped.

Further, the error message in dmesg shows the first 32 bytes of the
LEB, they show 0xFF.

I find this strange, I would think the block either:
A. Still has original EC, VID and data
B. Had been erased (no EC, VID, data), in which case it wouldn't be
mapped as LEB at all

Or I suppose this could be an issue with fastmap if the mapping was
read from FM but block was actually erased...

This is on older kernel (3.8.13), so it could be an already fixed
fastmap issue I suppose. I could go for a backport.

Q1: How "atomic" is volume truncate? Are the unmapped lebs erase
immediately or later?
Q2: Any foreseen big issues in backporting UBI & UBIFS updates to 3.8.13?

Cheers,
 - Juha



More information about the linux-mtd mailing list