public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Guido Martínez" <guido@vanguardiasur.com.ar>
To: Richard Weinberger <richard@nod.at>
Cc: dedekind1@gmail.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Andrew Murray <amurray@embedded-bits.co.uk>
Subject: Re: [PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY
Date: Wed, 17 Dec 2014 14:49:30 -0300	[thread overview]
Message-ID: <20141217174930.GA3400@fox> (raw)
In-Reply-To: <1416864610-5751-2-git-send-email-richard@nod.at>

On Mon, Nov 24, 2014 at 10:30:10PM +0100, Richard Weinberger wrote:
> 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.
Minor nitpick: should this say 'while it is open for writing' or 'an
UBIFS volume'? Renaming volumes opened for read-only (with ubiblock on
top for example) was already supported.

Regardless:

Tested name swapping mounted UBIFS volumes and read-only ubiblocks, as
well as UBI volumes opened for writing (not updating).

(for both patches)
Tested-by: Guido Martínez <guido@vanguardiasur.com.ar>
Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>

I'm not sure if we could now make the handler for UBI_IOCVOLUP take
read-write access instead of exclusive, but that's material for another
patch. Also I can't really think of a use case for that...


> 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 f5c715c..286383c 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",
> -- 
> 1.8.4.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar

  reply	other threads:[~2014-12-17 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 21:30 [PATCH 1/2] UBI: Implement UBI_METAONLY Richard Weinberger
2014-11-24 21:30 ` [PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY Richard Weinberger
2014-12-17 17:49   ` Guido Martínez [this message]
2015-01-20 19:50     ` Christoph Fritz
  -- strict thread matches above, loose matches on Subject: below --
2014-10-29 14:52 [PATCH 1/2] UBI: Implement UBI_METAONLY Richard Weinberger
2014-10-29 14:52 ` [PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141217174930.GA3400@fox \
    --to=guido@vanguardiasur.com.ar \
    --cc=amurray@embedded-bits.co.uk \
    --cc=dedekind1@gmail.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox