BLKRRPART bug + fix in mtd_blkdevs-24.c in mtd-snapshot-20040914.tar.bz2
Dear Mr. Woodhouse,
I've found a bug in the functions serving the BLKRRPART ioctl() in the 2.4 branch of MTD blkdevs. See the attached patch, I believe it contains a fix.
My DiskOnChip was detected just fine, but when I flushed the original partition and issued a BLKRRPART, the device would report half its original size. If I did it again, it would report a quarter size... etc.
Seems like the driver would re-init device size to a size denominated in 1k blocks, rather than sectors (512B).
Attached are two simple proggies that I'm using in my partitioning scripts.
Otherwise the driver seems to work just fine.
Actually I also had to insert
#ifndef CONFIG_MTD_CFI_GEOMETRY
#define CONFIG_MTD_MAP_BANK_WIDTH_1
#endif
at the beginning of $KERNEL/include/linux/mtd/map.h
to make it compile. Seems like a dependency mismatch between drivers/mtd/chips/Config.in and the headers/code. I don't have a CFI MTD, but I do need drivers/mtd/chips/chipreg.o even for my DiskOnChip (now a generic NFTL device).
Thanks for the great job you're doing on MTD :-)
Frank Rysanek
mtd_blkdevs-24.c renamed from mtd_blkdevs-24.old.c +1 -1
@@ -315,7 +315,7 @@ }grok_partitions (gd, minor,1 << tr->part_bits, - tr->blkcore_priv->sizes[minor]); + dev->size);up (&mtd_table_mutex);return 0 ;
The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any other MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance.
---- File information -----------
File: reset_disk.c
Date: 16 Sep 2004, 13:23
Size: 989 bytes.
Type: Program-sourceThe following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any other MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance.
---- File information -----------
File: geom.c
Date: 16 Sep 2004, 13:23
Size: 1569 bytes.
Type: Program-source