From: Dirk Behme <dirk.behme@gmail.com>
To: linux-mtd@lists.infradead.org, Artem Bityutskiy <dedekind1@gmail.com>
Cc: Dirk Behme <dirk.behme@de.bosch.com>,
Achim.Dahlhoff@de.bosch.com, Dirk Behme <dirk.behme@gmail.com>
Subject: Re: [PATCH] UBIFS: add tolerance to use variable writesize
Date: Wed, 22 May 2013 17:43:43 +0200 [thread overview]
Message-ID: <519CE7AF.9080103@gmail.com> (raw)
In-Reply-To: <1369237284-3559-1-git-send-email-dirk.behme@gmail.com>
Am 15.05.2013 17:41, schrieb Dirk Behme:
> From: Achim Dahlhoff <Achim.Dahlhoff@de.bosch.com>
>
> UBIfs adapts it‘s structures according to the minimum writeSize reported
> by the MTD device. For NOR flash devices, this is normally 1. For NOR
> devices with internal hardware-ECC it might be more, such as the S-Die
> flash chips of Micron which can use an internal ECC if the chip is
> accessed in 32 byte chunks.
>
> The UBIfs mount process checks and compares the writeSize set in the
> image and the writeSize reported from the /dev/mtd . UBIfs will fail
> to mount if the values differ. It should, though, not be a problem to
> mount an image which was created with a writeSize larger than that of
> the MTD, if it is larger by an integer factor.
>
> This commit changes the check in a way so it will allow the image
> writeSize to be larger than that of the MTD by an integer factor.
> It will allow to create images and deploy them on different devices
> using different writeSizes. writeSize found using values of 1, 8 and 32.
>
> Signed-off-by: Achim Dahlhoff <Achim.Dahlhoff@de.bosch.com>
> ---
> fs/ubifs/sb.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c
> index 4c37607..69dd794 100644
> --- a/fs/ubifs/sb.c
> +++ b/fs/ubifs/sb.c
> @@ -351,6 +351,7 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
> {
> long long max_bytes;
> int err = 1, min_leb_cnt;
> + int chk_tmp;
>
> if (!c->key_hash) {
> err = 2;
> @@ -362,9 +363,16 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
> goto failed;
> }
>
> - if (le32_to_cpu(sup->min_io_size) != c->min_io_size) {
> + /*
> + * Allow a min_io_size mismatch in the way that
> + * the size in the superblock (the image) is larger by
> + * an integer factor. If image-IOsize mod real-IOsize
> + * is zero, it should be ok to mount this.
> + */
> + chk_tmp = le32_to_cpu(sup->min_io_size);
> + if (chk_tmp != c->min_io_size && ((chk_tmp%c->min_io_size) != 0)) {
> ubifs_err("min. I/O unit mismatch: %d in superblock, %d real",
> - le32_to_cpu(sup->min_io_size), c->min_io_size);
> + chk_tmp, c->min_io_size);
> goto failed;
> }
Any comments on this?
Many thanks
Dirk
next parent reply other threads:[~2013-05-22 15:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1369237284-3559-1-git-send-email-dirk.behme@gmail.com>
2013-05-22 15:43 ` Dirk Behme [this message]
2013-05-15 16:21 [PATCH] UBIFS: add tolerance to use variable writesize Dirk Behme
2013-07-01 7:55 ` Artem Bityutskiy
2013-07-01 8:32 ` Dahlhoff Achim (CM-AI/PJ-CF32)
2013-07-01 9:33 ` Artem Bityutskiy
2013-07-04 11:50 ` Dirk Behme
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=519CE7AF.9080103@gmail.com \
--to=dirk.behme@gmail.com \
--cc=Achim.Dahlhoff@de.bosch.com \
--cc=dedekind1@gmail.com \
--cc=dirk.behme@de.bosch.com \
--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;
as well as URLs for NNTP newsgroup(s).