RFC : attach ubi in readonly mode

Artem Bityutskiy dedekind1 at gmail.com
Fri Feb 3 09:09:21 EST 2012


On Fri, 2012-02-03 at 14:40 +0100, Matthieu CASTET wrote:
> Hi,
> 
> it could be interesting to attach ubi in read-only mode (for example getting ubi
> volume info without altering flash).
> 
> A solution to do that could be to add an argument to UBI_IOCATT ioctl.

No objections in general, especially if you also:

1. amend the mtd-utils and add support for this option
2. add a piece of doc for the mtd web site
3. add a test for this feature to mtd-utils.git/tests/ubi-test/
(probably simpler to improve one of the existing tests there)

> Another solution should be to have a way to switch MTD_WRITEABLE flags.

This can be done as well, up to you. But I guess UBI will need changes
anyway to handle gracefully situation like:

1. you have RW partition, do a lot of I/O, then reboot uncleanly, so
that there are many erase operations unfinished

2. You reboot, mark the partition R/O, try to attach it - UBI will
probably anyway try to erase some blocks and get -EFORS, not sure will
it panic or not. Should be tested, but probably not a big deal.

IOW, both approaches should be OK.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120203/b336cb15/attachment-0001.sig>


More information about the linux-mtd mailing list