[PATCH v2] ubi: Make recover_peb power cut aware
Richard Weinberger
richard at nod.at
Wed Jun 22 13:04:32 PDT 2016
Am 22.06.2016 um 16:44 schrieb Jörg Pfähler:
> Reviewed-by: Jörg Pfähler <pfaehler at isse.de>
>
> Am Dienstag, 21. Juni 2016, 00:31:50 CEST schrieb Richard Weinberger:
>> recover_peb() was never power cut aware,
>> if a power cut happened right after writing the VID header
>> upon next attach UBI would blindly use the new partial written
>> PEB and all data from the old PEB is lost.
>>
>> In order to make recover_peb() power cut aware, write the new
>> VID with a proper crc and copy_flag set such that the UBI attach
>> process will detect whether the new PEB is completely written
>> or not.
>> We cannot directly use ubi_eba_atomic_leb_change() since we'd
>> have to unlock the LEB which is facing a write error.
>>
>> Cc: stable at vger.kernel.org
>> Reported-by: Jörg Pfähler <pfaehler at isse.de>
>> Signed-off-by: Richard Weinberger <richard at nod.at>
Applied and pushed into linux-next.
Thanks,
//richard
More information about the linux-mtd
mailing list