linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ubi : generate random image_seq when attaching empty MTD device
@ 2010-06-03 14:14 Matthieu CASTET
  2010-06-03 14:25 ` Artem Bityutskiy
  2010-06-08  8:45 ` Artem Bityutskiy
  0 siblings, 2 replies; 4+ messages in thread
From: Matthieu CASTET @ 2010-06-03 14:14 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

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

generate random image_seq when attaching empty MTD device (kernel do the 
ubi formating).

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

[-- Attachment #2: ubi.diff --]
[-- Type: text/x-diff, Size: 706 bytes --]

diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index aed19f3..7a95ff3 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -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

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

* Re: [PATCH] ubi : generate random image_seq when attaching empty MTD device
  2010-06-03 14:14 [PATCH] ubi : generate random image_seq when attaching empty MTD device Matthieu CASTET
@ 2010-06-03 14:25 ` Artem Bityutskiy
  2010-06-08  8:45 ` Artem Bityutskiy
  1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2010-06-03 14:25 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd@lists.infradead.org

On Thu, 2010-06-03 at 16:14 +0200, Matthieu CASTET wrote:
> generate random image_seq when attaching empty MTD device (kernel do the 
> ubi formating).
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

Looks OK, I'll push it to the UBI tree as soon as I have time - very
busy right now, thanks.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] ubi : generate random image_seq when attaching empty MTD device
  2010-06-03 14:14 [PATCH] ubi : generate random image_seq when attaching empty MTD device Matthieu CASTET
  2010-06-03 14:25 ` Artem Bityutskiy
@ 2010-06-08  8:45 ` Artem Bityutskiy
  2010-06-10 13:37   ` Matthieu CASTET
  1 sibling, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2010-06-08  8:45 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd@lists.infradead.org

On Thu, 2010-06-03 at 16:14 +0200, Matthieu CASTET wrote:
> generate random image_seq when 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.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] ubi : generate random image_seq when attaching empty MTD device
  2010-06-08  8:45 ` Artem Bityutskiy
@ 2010-06-10 13:37   ` Matthieu CASTET
  0 siblings, 0 replies; 4+ messages in thread
From: Matthieu CASTET @ 2010-06-10 13:37 UTC (permalink / raw)
  To: dedekind1@gmail.com; +Cc: linux-mtd@lists.infradead.org

Artem Bityutskiy a écrit :
> On Thu, 2010-06-03 at 16:14 +0200, Matthieu CASTET wrote:
>> generate random image_seq when 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.

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

end of thread, other threads:[~2010-06-10 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 14:14 [PATCH] ubi : generate random image_seq when attaching empty MTD device Matthieu CASTET
2010-06-03 14:25 ` Artem Bityutskiy
2010-06-08  8:45 ` Artem Bityutskiy
2010-06-10 13:37   ` Matthieu CASTET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).