Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1693956 > unrolled thread
| Started by | Richard Weinberger <richard.weinberger@gmail.com> |
|---|---|
| First post | 2017-07-21 22:20 +0200 |
| Last post | 2017-07-25 16:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 5/5] ubi: Allow to use read-only UBI volume with not enough PEBs Richard Weinberger <richard.weinberger@gmail.com> - 2017-07-21 22:20 +0200
Re: [PATCH 5/5] ubi: Allow to use read-only UBI volume with not enough PEBs Pali Rohár <pali.rohar@gmail.com> - 2017-07-25 16:30 +0200
| From | Richard Weinberger <richard.weinberger@gmail.com> |
|---|---|
| Date | 2017-07-21 22:20 +0200 |
| Subject | Re: [PATCH 5/5] ubi: Allow to use read-only UBI volume with not enough PEBs |
| Message-ID | <u5MyZ-Tz-5@gated-at.bofh.it> |
Pali,
On Fri, Jun 2, 2017 at 5:43 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> In read-only mode is skipped auto-resize. For pre-build images ready for
> auto-resize there can be reserved more PEBs as whole size of pre-build
> image. In read-only we do not do any write operation therefore this would
> allow to use read-only UBI volume which is not auto-resized yet.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
> drivers/mtd/ubi/vtbl.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
> index 263743e..1d708c5 100644
> --- a/drivers/mtd/ubi/vtbl.c
> +++ b/drivers/mtd/ubi/vtbl.c
> @@ -240,8 +240,10 @@ static int vtbl_check(const struct ubi_device *ubi,
> if (reserved_pebs > ubi->good_peb_count) {
> ubi_err(ubi, "too large reserved_pebs %d, good PEBs %d",
> reserved_pebs, ubi->good_peb_count);
> - err = 9;
> - goto bad;
> + if (!ubi->ro_mode) {
> + err = 9;
> + goto bad;
> + }
I fear this is not correct, it will disable a legit self-check of UBI volumes.
If the read-only volume is corrupted/truncated and you miss PEBs, this
check will no longer
trigger.
Especially when dealing with nanddumps, truncation is a common problem.
--
Thanks,
//richard
[toc] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2017-07-25 16:30 +0200 |
| Message-ID | <u790v-3Vq-5@gated-at.bofh.it> |
| In reply to | #1693956 |
On Friday 21 July 2017 22:12:51 Richard Weinberger wrote:
> Pali,
>
> On Fri, Jun 2, 2017 at 5:43 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > In read-only mode is skipped auto-resize. For pre-build images ready for
> > auto-resize there can be reserved more PEBs as whole size of pre-build
> > image. In read-only we do not do any write operation therefore this would
> > allow to use read-only UBI volume which is not auto-resized yet.
> >
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> > drivers/mtd/ubi/vtbl.c | 14 +++++++++-----
> > 1 file changed, 9 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
> > index 263743e..1d708c5 100644
> > --- a/drivers/mtd/ubi/vtbl.c
> > +++ b/drivers/mtd/ubi/vtbl.c
> > @@ -240,8 +240,10 @@ static int vtbl_check(const struct ubi_device *ubi,
> > if (reserved_pebs > ubi->good_peb_count) {
> > ubi_err(ubi, "too large reserved_pebs %d, good PEBs %d",
> > reserved_pebs, ubi->good_peb_count);
> > - err = 9;
> > - goto bad;
> > + if (!ubi->ro_mode) {
> > + err = 9;
> > + goto bad;
> > + }
>
> I fear this is not correct, it will disable a legit self-check of UBI volumes.
> If the read-only volume is corrupted/truncated and you miss PEBs, this
> check will no longer
> trigger.
>
> Especially when dealing with nanddumps, truncation is a common problem.
Any idea how to fix it? Or how to handle read-only images which are
marked for auto-resize?
--
Pali Rohár
pali.rohar@gmail.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web