From: Artem Bityutskiy <dedekind1@gmail.com>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: "Brian Norris" <computersforpeace@gmail.com>,
linux-mtd@lists.infradead.org,
"Guido Martínez" <guido@vanguardiasur.com.ar>
Subject: Re: [PATCH 1/3] UBI: block: Fix block device size setting
Date: Mon, 08 Sep 2014 13:52:44 +0300 [thread overview]
Message-ID: <1410173564.10764.146.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1409348550-27768-2-git-send-email-ezequiel.garcia@free-electrons.com>
On Fri, 2014-08-29 at 18:42 -0300, Ezequiel Garcia wrote:
> We are currently taking the block device size from the ubi_volume_info.size
> field. However, this is not the amount of data in the volume, but the
> number of reserved physical eraseblocks, and hence leads to an incorrect
> representation of the volume.
>
> In particular, this produces I/O errors on static volumes as the block
> interface may attempt to read unmapped PEBs:
>
> $ cat /dev/ubiblock0_0 > /dev/null
> UBI error: ubiblock_read_to_buf: ubiblock0_0 ubi_read error -22
> end_request: I/O error, dev ubiblock0_0, sector 9536
> Buffer I/O error on device ubiblock0_0, logical block 2384
> [snip]
>
> Fix this by using the ubi_volume_info.used_bytes field which is set to the
> actual number of data bytes for both static and dynamic volumes.
>
> While here, improve the error message to be less stupid and more useful:
> UBI error: ubiblock_read_to_buf: ubiblock0_1 ubi_read error -9 on LEB=0, off=15872, len=512
>
> It's worth noticing that the 512-byte sector representation of the volume
> is only correct if the volume size is multiple of 512-bytes. This is true for
> virtually any NAND device, given eraseblocks and pages are 512-byte multiple
> and hence so is the LEB size.
>
> Fixes: 9d54c8a33eec ("UBI: R/O block driver on top of UBI volumes")
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Looks good, do we want this one in stable?
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2014-09-08 10:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 21:42 [PATCH 0/3] UBI: block: Some fixes for static volumes Ezequiel Garcia
2014-08-29 21:42 ` [PATCH 1/3] UBI: block: Fix block device size setting Ezequiel Garcia
2014-09-08 10:52 ` Artem Bityutskiy [this message]
2014-08-29 21:42 ` [PATCH 2/3] UBI: block: Add support for the UBI_VOLUME_UPDATED notification Ezequiel Garcia
2014-09-08 10:54 ` Artem Bityutskiy
2014-09-08 11:18 ` Ezequiel Garcia
2014-09-08 12:47 ` Artem Bityutskiy
2014-09-08 18:27 ` Ezequiel Garcia
2014-09-16 15:15 ` Artem Bityutskiy
2014-09-16 15:23 ` Artem Bityutskiy
2014-09-16 15:32 ` Ezequiel Garcia
2014-09-16 15:35 ` Ezequiel Garcia
2014-09-16 15:53 ` Artem Bityutskiy
2014-09-16 15:56 ` Ezequiel Garcia
2014-09-16 16:04 ` Artem Bityutskiy
2014-08-29 21:42 ` [PATCH 3/3] UBI: Dispatch update notification if the volume is updated Ezequiel Garcia
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=1410173564.10764.146.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=guido@vanguardiasur.com.ar \
--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