UBI_READWRITE constraint when opening volumes to rename

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Tue Oct 7 07:49:41 PDT 2014


On 07 Oct 03:31 PM, Andrew Murray wrote:
> Hello,
> 
> I'd like to be able to safely rename a UBI volume that contains a
> mounted UBIFS volume.
> 
> This allows for firmware upgrade via the following steps:
> 
> - ubimkvol rootfs_new
> - ubiupdatevol rootfs_new
> - ubirename rootfs rootfs_old rootfs_new rootfs
> - reboot
> - ubirmvol rootfs_old
> 
> Such an approach makes upgrade of a root filesystem simple as there is
> no need to unmount the root filesystem. I believe this question has
> been asked before on this mailing list
> (http://lists.infradead.org/pipermail/linux-mtd/2012-February/039743.html).
> 
> This process isn't possible at the moment as 'rename_volumes' opens
> the UBI volume with UBI_READWRITE. Unfortunately UBIFS always opens
> UBI with UBI_READWRITE regardless to if the user mounts as read-only.
> If 'rename_volumes' is changed to UBI_READONLY then the above process
> works.
> 

Maybe there's some way to tell UBIFS to pause any writes and switch
to read-only temporarily, while the rename takes place?

Does this make any sense?

> I understand that this patch
> https://patchwork.ozlabs.org/patch/339711/ recently changed the first
> open restraint in 'rename_volumes' from UBI_EXCLUSIVE to
> UBI_READWRITE. I'd like to understand if there are any risks in
> changing it to UBI_READONLY?
> 

-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list