lkml.org 
[lkml]   [2014]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY
    Date
    By using UBI_METAONLY in rename_volumes() it is now possible to rename
    an UBI volume atomically while it is mounted.
    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>
    ---
    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 5f01edd..fcdf7b9 100644
    --- a/drivers/mtd/ubi/cdev.c
    +++ b/drivers/mtd/ubi/cdev.c
    @@ -735,7 +735,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("cannot open volume %d, error %d", vol_id, err);
    --
    1.8.4.5


    \
     
     \ /
      Last update: 2014-10-29 16:01    [W:3.414 / U:0.492 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site