aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-11-24 16:30:10 -0500
committerRichard Weinberger <richard@nod.at>2015-01-28 09:57:13 -0500
commit892abde56c1c5a62d49d8b70c73e5d388e74345d (patch)
treef2641cddfc53dc4ac8204a500ba630e7aede6cc8
parentfafdd2bf2638157670f28462b641150d16dbaeca (diff)
UBI: rename_volumes: Use UBI_METAONLY
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>
-rw-r--r--drivers/mtd/ubi/cdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index f5c715c32dcd..286383c11126 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -736,7 +736,7 @@ static int rename_volumes(struct ubi_device *ubi,
736 goto out_free; 736 goto out_free;
737 } 737 }
738 738
739 re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_READWRITE); 739 re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_METAONLY);
740 if (IS_ERR(re->desc)) { 740 if (IS_ERR(re->desc)) {
741 err = PTR_ERR(re->desc); 741 err = PTR_ERR(re->desc);
742 ubi_err(ubi, "cannot open volume %d, error %d", 742 ubi_err(ubi, "cannot open volume %d, error %d",