public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörg Pfähler" <pfaehler@isse.de>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: UBI: recover_peb and power cut safety
Date: Mon, 20 Jun 2016 15:48:22 +0200	[thread overview]
Message-ID: <4747649.kxTirKoIZH@pfaehler-pc> (raw)
In-Reply-To: <CAFLxGvzxEkRfGzxsxS3_xYupPvAXNO6X9AMi=6SQzXYqBLqiqQ@mail.gmail.com>

Hi Richard,

> Hmm, you are right, if ubi_eba_write() is facing -EIO from the MTD driver we
> can lose the whole erase block upon power cut.
> So you found a bug. :-)
>
> Artem, can you tell more on this?
> I'd guess that recover_peb() is older than ubi_eba_atomic_leb_change() and
> therefore it was not used.
> And nobody noticed so far since the condition is hard to hit.
> 
> That said, switching to ubi_eba_atomic_leb_change() seems like a good
> plan to me.
> Jörg, please send a patch and explain how you tested it.

First of all, thanks for confirming this bug so quickly.

However, we would like to refrain from providing a patch. A little inspection 
of the code revealed that the locking is different for both methods, i.e., one 
cannot just call ubi_eba_atomic_leb_change. So it would be a larger change to 
the code than we thought. Furthermore, we have no experience in writing or 
debugging code for the linux kernel and we own only one flash chip for 
testing, so we would not feel very confident in any patch we could provide.

We found the bug rather in the formal verification of a model of UBI/UBIFS 
(see http://www.isse.de/flashix for more details on our project), where it 
turned out that we modeled the feature differently.

MfG,
Jörg

--------------------------------------------------------------------------------------
Jörg Pfähler
Lehrstuhl für Softwaretechnik
Institut für Software and Systems Engineering
Universität Augsburg

Universitätsstr. 6a, Raum 3014
tel:      (+49) 821/598-2229
e-mail:   pfaehler@isse.de<mailto:pfaehler@isse.de>
--------------------------------------------------------------------------------------

      parent reply	other threads:[~2016-06-20 13:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16  8:37 UBI: recover_peb and power cut safety Jörg Pfähler
2016-06-16  9:46 ` Richard Weinberger
2016-06-16 10:03   ` Richard Weinberger
2016-06-17  6:37     ` Artem Bityutskiy
2016-06-20 13:48   ` Jörg Pfähler [this message]

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=4747649.kxTirKoIZH@pfaehler-pc \
    --to=pfaehler@isse.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.weinberger@gmail.com \
    /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