ubi : generate random image_seq when attaching empty MTD device
Subsystems (2)
PATCH 1/1 ubi : generate random image_seq when attaching empty MTD device
generate random image_seq when attaching empty MTD device (kernel do the ubi formating).
drivers/mtd/ubi/scan.c +4 -1
@@ -44,6 +44,7 @@#include <linux/slab.h> #include <linux/crc32.h> #include <linux/math64.h> +#include <linux/random.h> #include "ubi.h" #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
@@ -935,8 +936,10 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)if (si->ec_count) si->mean_ec =div_u64 (si->ec_sum, si->ec_count); -if (si->is_empty) +if (si->is_empty) {ubi_msg ("empty MTD device detected" ); +get_random_bytes (&ubi->image_seq,sizeof (ubi->image_seq)); + }/* * Few corrupted PEBs are not a problem and may be just a result of
Quoted 4 lines · Matthieu CASTET
generate random
image_seqwhen attaching empty MTD device (kernel do the ubi formating).Signed-off-by Matthieu CASTET <[email protected]>
Looks OK, I'll push it to the UBI tree as soon as I have time - very busy right now, thanks.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Quoted 2 lines · Matthieu CASTET
generate random
image_seqwhen attaching empty MTD device (kernel do the ubi formating).
Your patch did not apply to the ubi-2.6.git master, because it conflicted with my latest changes. But I amended it and pushed, but you should probably check.
Thanks.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Quoted 7 lines · Artem Bityutskiy
Quoted 1 line · Matthieu CASTET
generate random
image_seqwhen attaching empty MTD device (kernel do the ubi formating).Your patch did not apply to the ubi-2.6.git master, because it conflicted with my latest changes. But I amended it and pushed, but you should probably check.
It looks fine.
Thanks.