Suggested patch: reset errno after isatty()

Ketil Froyn ketil at froyn.name
Wed Nov 17 10:50:47 EST 2010


On Sat, Nov 13, 2010 at 12:55 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Sat, 2010-11-13 at 13:07 +0200, Artem Bityutskiy wrote:
>>
>> however, Mike is right, fixes should be back-ports, or if you fix a
>> problem in the older release, you should fix it in the master branch as
>> well, or show that it does not exist in the master branch. This is the
>> only way it is possible to keep development under control.
>>
>> We really need to be sure that whatever is fixed in older releases is
>> also fixed in the newer. Yes, this is more work for you but hey, I'm
>> also doing this stuff in my spare time.
>
> BTW, with patches from Brian Norris which I just pushed the master
> branch may work better for you.

I've managed to build mtd-utils for my android device, using
codesourcery's toolchain. I built a static nanddump executable, copied
it to my device, and ran it. Here's what happened:

# nanddump -f /sdcard/mtd5.dump /dev/mtd/mtd5
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 0
Dumping data starting at 0x00000000 and ending at 0x0a5c0000...
Segmentation fault

The OOB size shown is 0, which is wrong, while the detected block size
and page size are correct. The old version used to complain:

# nanddump -f /sdcard/mtd5.dump /dev/mtd/mtd5
Unknown flash (not normal NAND)

until I did some debugging and found out that my device has an OOB
size of 56... This patch against v1.4.1 fixed that version:

--- a/nanddump.c
+++ b/nanddump.c
@@ -308,6 +308,7 @@ int main(int argc, char * const argv[])
                        !(meminfo.oobsize == 128 && meminfo.writesize == 4096) &
                        !(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
                        !(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
+                       !(meminfo.oobsize == 56 && meminfo.writesize == 2048) &&
                        !(meminfo.oobsize == 32 && meminfo.writesize == 1024) &&
                        !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
                        !(meminfo.oobsize == 8 && meminfo.writesize == 256)) {


I've done some digging around in the new code, but I haven't worked
out exactly why the OOB size is set to 0. I haven't figured out
exactly what it does yet... Or could it have anything to do with my
build environment?

Cheers, Ketil



More information about the linux-mtd mailing list