* [Resent with proper line wrap] Request for comments: UBI PEBs as a multiple of erase size
2011-09-13 19:36 Request for comments: UBI PEBs as a multiple of erase size Kevin Paul Herbert
@ 2011-09-14 5:21 ` Kevin Paul Herbert
2012-03-09 13:41 ` Artem Bityutskiy
2011-09-14 12:01 ` Atlant Schmidt
2011-09-19 4:55 ` Artem Bityutskiy
2 siblings, 1 reply; 5+ messages in thread
From: Kevin Paul Herbert @ 2011-09-14 5:21 UTC (permalink / raw)
To: linux-mtd
[Sorry for the ugly lack of line-wrap... I thought I knew better. :-)]
I came across a situation where I wanted to be able to use the same pre-built
(with UBI) image on two different FLASH devices, one of which having a
larger erase size than the other. I actually did not notice that the device
I was using had a different erase size, which caused UBI to quietly corrupt
my FLASH.
I have a patch to UBI (kernel and ubinize) to store the size of a PEB in
the EC header, reject attaching if the PEB size is not equal to or an
integer multiple of the erase size, and treat multiple erase blocks
as a "cluster" for I/O operations.
I looked through a few months of archives to see if this is a common
problem, and I don't see this as being discussed. Is there interest in
me publishing this patch for inclusion in the kernel. The only
downside I can see of my change is that it adds an additional 32 bit
quantity to struct ubi_ec_hdr, reducing the available free header bytes
from 35 to 31. For backwards compatibility, if this field is zero,
I treat it as PEB size == erase size.
It seems to me that having the PEB size in the header, regardless of
supporting multiple erase blocks as a single PEB, is a useful consistency
check.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Resent with proper line wrap] Request for comments: UBI PEBs as a multiple of erase size
2011-09-14 5:21 ` [Resent with proper line wrap] " Kevin Paul Herbert
@ 2012-03-09 13:41 ` Artem Bityutskiy
0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2012-03-09 13:41 UTC (permalink / raw)
To: Kevin Paul Herbert; +Cc: linux-mtd
On Tue, 2011-09-13 at 22:21 -0700, Kevin Paul Herbert wrote:
> [Sorry for the ugly lack of line-wrap... I thought I knew better. :-)]
>
> I came across a situation where I wanted to be able to use the same pre-built
> (with UBI) image on two different FLASH devices, one of which having a
> larger erase size than the other. I actually did not notice that the device
> I was using had a different erase size, which caused UBI to quietly corrupt
> my FLASH.
Feel free to send a patch, sure.
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Request for comments: UBI PEBs as a multiple of erase size
2011-09-13 19:36 Request for comments: UBI PEBs as a multiple of erase size Kevin Paul Herbert
2011-09-14 5:21 ` [Resent with proper line wrap] " Kevin Paul Herbert
@ 2011-09-14 12:01 ` Atlant Schmidt
2011-09-19 4:55 ` Artem Bityutskiy
2 siblings, 0 replies; 5+ messages in thread
From: Atlant Schmidt @ 2011-09-14 12:01 UTC (permalink / raw)
To: 'Kevin Paul Herbert', linux-mtd@lists.infradead.org
Kevin:
I would support this change.
Today, do we allow "mixed" NAND Flash device with the
possibility of multiple Erase Block sizes? It seems to
me that your patch, fully-fleshed-out, would allow this
and that also seems like a good thing.
Atlant
-----Original Message-----
From: linux-mtd-bounces@lists.infradead.org [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Kevin Paul Herbert
Sent: Tuesday, September 13, 2011 15:37
To: linux-mtd@lists.infradead.org
Subject: Request for comments: UBI PEBs as a multiple of erase size
I came across a situation where I wanted to be able to use the same pre-built (with UBI) image on two different FLASH devices, one of which having a larger erase size than the other. I actually did not notice that the device I was using had a different erase size, which caused UBI to quietly corrupt my FLASH.
I have a patch to UBI (kernel and ubinize) to store the size of a PEB in the EC header, reject attaching if the PEB size is not equal to or an integer multiple of the erase size, and treat multiple erase blocks as a "cluster" for I/O operations.
I looked through a few months of archives to see if this is a common problem, and I don't see this as being discussed. Is there interest in me publishing this patch for inclusion in the kernel. The only downside I can see of my change is that it adds an additional 32 bit quantity to struct ubi_ec_hdr, reducing the available free header byets from 35 to 31. For backwards compatibility, if this field is zero, I treat it as PEB size == erase size.
It seems to me that having the PEB size in the header, regardless of supporting multiple erase blocks as a single PEB, is a useful consistency check.
Comments please?
Thanks,
Kevin Paul Herbert
Meraki, Inc.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Click https://www.mailcontrol.com/sr/1VFWYhVYdxnTndxI!oX7Ulvwl1GqFAPrK44JbcO+1AA0rpc5OYymogGZMwDw3dul6eIk5VgOkcDieLvRJKIvyA== to report this email as spam.
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Request for comments: UBI PEBs as a multiple of erase size
2011-09-13 19:36 Request for comments: UBI PEBs as a multiple of erase size Kevin Paul Herbert
2011-09-14 5:21 ` [Resent with proper line wrap] " Kevin Paul Herbert
2011-09-14 12:01 ` Atlant Schmidt
@ 2011-09-19 4:55 ` Artem Bityutskiy
2 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2011-09-19 4:55 UTC (permalink / raw)
To: Kevin Paul Herbert; +Cc: linux-mtd
On Tue, 2011-09-13 at 12:36 -0700, Kevin Paul Herbert wrote:
> I came across a situation where I wanted to be able to use the same
> pre-built (with UBI) image on two different FLASH devices, one of
> which having a larger erase size than the other. I actually did not
> notice that the device I was using had a different erase size, which
> caused UBI to quietly corrupt my FLASH.
>
> I have a patch to UBI (kernel and ubinize) to store the size of a PEB
> in the EC header, reject attaching if the PEB size is not equal to or
> an integer multiple of the erase size, and treat multiple erase blocks
> as a "cluster" for I/O operations.
>
> I looked through a few months of archives to see if this is a common
> problem, and I don't see this as being discussed. Is there interest in
> me publishing this patch for inclusion in the kernel. The only
> downside I can see of my change is that it adds an additional 32 bit
> quantity to struct ubi_ec_hdr, reducing the available free header
> byets from 35 to 31. For backwards compatibility, if this field is
> zero, I treat it as PEB size == erase size.
>
> It seems to me that having the PEB size in the header, regardless of
> supporting multiple erase blocks as a single PEB, is a useful
> consistency check.
>
> Comments please?
I think we do have this kind of "protection" in UBIFS, but non in UBI.
Please, go ahead and send patches!
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 5+ messages in thread