Skip to content

Commit

Permalink
UBI: rename_volumes: Use UBI_METAONLY
Browse files Browse the repository at this point in the history
By using UBI_METAONLY in rename_volumes() it is now possible to rename
an UBI volume atomically while it is open for writing.
This is useful for firmware upgrades.

Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Andrew Murray <amurray@embedded-bits.co.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Tested-by: Guido Martínez <guido@vanguardiasur.com.ar>
Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
Tested-by: Christoph Fritz <chf.fritz@googlemail.com>
Tested-by: Andrew Murray <amurray@embedded-bits.co.uk>
  • Loading branch information
Richard Weinberger committed Jan 28, 2015
1 parent fafdd2b commit 892abde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ static int rename_volumes(struct ubi_device *ubi,
goto out_free;
}

re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_READWRITE);
re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_METAONLY);
if (IS_ERR(re->desc)) {
err = PTR_ERR(re->desc);
ubi_err(ubi, "cannot open volume %d, error %d",
Expand Down

0 comments on commit 892abde

Please sign in to comment.