From 892abde56c1c5a62d49d8b70c73e5d388e74345d Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 24 Nov 2014 22:30:10 +0100 Subject: [PATCH] UBI: rename_volumes: Use UBI_METAONLY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Andrew Murray Signed-off-by: Richard Weinberger Tested-by: Guido Martínez Reviewed-by: Guido Martínez Tested-by: Christoph Fritz Tested-by: Andrew Murray --- drivers/mtd/ubi/cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, 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",