[PATCH] UBI : erase free PEB with bitflip in EC header

Shmulik Ladkani shmulik.ladkani at gmail.com
Thu Aug 23 03:19:35 EDT 2012


Hi Matthieu,

On Wed, 22 Aug 2012 16:03:46 +0200 Matthieu CASTET <matthieu.castet at 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



More information about the linux-mtd mailing list