mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Richard Weinberger <richard@nod.at>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Andrew Murray <amurray@embedded-bits.co.uk>
Subject: [PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY
Date: Mon, 24 Nov 2014 22:30:10 +0100	[thread overview]
Message-ID: <1416864610-5751-2-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1416864610-5751-1-git-send-email-richard@nod.at>

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 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


  reply	other threads:[~2014-11-24 21:30 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 ` Richard Weinberger [this message]
2014-12-17 17:49   ` [PATCH 2/2] UBI: rename_volumes: Use UBI_METAONLY Guido Martínez
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=1416864610-5751-2-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --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 \
    /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

all inboxes | Powered by JetHome®