public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] UBI : erase free PEB with bitflip in EC header
@ 2012-08-22 14:03 Matthieu CASTET
  2012-08-23  7:19 ` Shmulik Ladkani
  2012-08-25 12:27 ` Artem Bityutskiy
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu CASTET @ 2012-08-22 14:03 UTC (permalink / raw)
  To: linux-mtd, dedekind1; +Cc: Matthieu CASTET

Without this patch, these PEB are not scrubbed until we put data in them.
Bitflip can accumulate latter and we can loose the EC header (but VID header
should be intact and allow to recover data)

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
---
 drivers/mtd/ubi/attach.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index bd27cbb..68d4d1f 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -975,7 +975,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
 			return err;
 		goto adjust_mean_ec;
 	case UBI_IO_FF:
-		if (ec_err)
+		if (ec_err || bitflips)
 			err = add_to_list(ai, pnum, UBI_UNKNOWN,
 					  UBI_UNKNOWN, ec, 1, &ai->erase);
 		else
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] UBI : erase free PEB with bitflip in EC header
  2012-08-22 14:03 [PATCH] UBI : erase free PEB with bitflip in EC header Matthieu CASTET
@ 2012-08-23  7:19 ` Shmulik Ladkani
  2012-08-25 12:27 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Shmulik Ladkani @ 2012-08-23  7:19 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd, dedekind1

Hi Matthieu,

On Wed, 22 Aug 2012 16:03:46 +0200 Matthieu CASTET <matthieu.castet@parrot.com> wrote:
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index bd27cbb..68d4d1f 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -975,7 +975,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
>  			return err;
>  		goto adjust_mean_ec;
>  	case UBI_IO_FF:
> -		if (ec_err)
> +		if (ec_err || bitflips)

Thanks, it looks correct to me.

Note that:

-		if (ec_err)
+		if (bitflips)

will also do the job (since bitflips is also set when ec_err is set),
and maybe that was the intention, according to this comment:
		 * We have to also look at the VID header, possibly it is not
		 * corrupted. Set %bitflips flag in order to make this PEB be
		 * moved and EC be re-created.

Regards,
Shmulik

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] UBI : erase free PEB with bitflip in EC header
  2012-08-22 14:03 [PATCH] UBI : erase free PEB with bitflip in EC header Matthieu CASTET
  2012-08-23  7:19 ` Shmulik Ladkani
@ 2012-08-25 12:27 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 12:27 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Wed, 2012-08-22 at 16:03 +0200, Matthieu CASTET wrote:
> Without this patch, these PEB are not scrubbed until we put data in them.
> Bitflip can accumulate latter and we can loose the EC header (but VID header
> should be intact and allow to recover data)
> 
> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>

Pushed to linux-ubi, thanks! Also added:
Cc: stable@vger.kernel.org

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-25 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 14:03 [PATCH] UBI : erase free PEB with bitflip in EC header Matthieu CASTET
2012-08-23  7:19 ` Shmulik Ladkani
2012-08-25 12:27 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox