2001-10-11 20:01:40

by Alexander Viro

[permalink] [raw]
Subject: Partitioning problems in 2.4.11

OK, folks. Right now we have at least 3 cases that look like
breakage in check_partition(). All of them had appeared between 2.4.10
and 2.4.11.

a) does 2.4.10-ac12 work for you? It had got essentially the same
partition-related code that we have in 2.4.11. I suspect that causes
of breakage are different, so the answer may not be the same for everybody
affected.

b) there are two bugs - one common for -ac and 2.4.11, another - 2.4.11-only.
I really doubt that the first one had been triggered in any of these cases.
The second might be.

c) in one case we have something very nasty - perfectly sane partition tables
as read by dd(1) and read on the right sector returning crap. And that read
had been traced down to setting the right ->b_blocknr with right ->i_blkbits
and ->i_size.

d) patch below closes two known holes. It's known to be not enough in
one case (see above) and unlikely to help in another (sda9). However,
let's get these holes out of the way first.

e) extra eyes on max_block() might be a good idea. It looks like we
don't get it right. I don't see immediate problems (after fixing the
->i_blkbits hole), but...

diff -urN S11/fs/block_dev.c S11-part/fs/block_dev.c
--- S11/fs/block_dev.c Thu Oct 11 11:29:27 2001
+++ S11-part/fs/block_dev.c Thu Oct 11 15:50:52 2001
@@ -24,29 +24,6 @@

#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)

-static inline unsigned int blksize_bits(unsigned int size)
-{
- unsigned int bits = 8;
- do {
- bits++;
- size >>= 1;
- } while (size > 256);
- return bits;
-}
-
-static inline unsigned int block_size(kdev_t dev)
-{
- int retval = BLOCK_SIZE;
- int major = MAJOR(dev);
-
- if (blksize_size[major]) {
- int minor = MINOR(dev);
- if (blksize_size[major][minor])
- retval = blksize_size[major][minor];
- }
- return retval;
-}
-
static unsigned long max_block(kdev_t dev)
{
unsigned int retval = ~0U;
diff -urN S11/fs/partitions/check.c S11-part/fs/partitions/check.c
--- S11/fs/partitions/check.c Tue Oct 9 21:47:27 2001
+++ S11-part/fs/partitions/check.c Thu Oct 11 15:50:11 2001
@@ -247,6 +247,7 @@
printk(KERN_INFO " %s:", disk_name(hd, MINOR(dev), buf));
bdev = bdget(kdev_t_to_nr(dev));
bdev->bd_inode->i_size = (loff_t)hd->part[MINOR(dev)].nr_sects << 9;
+ bdev->bd_inode->i_blkbits = blksize_bits(block_size(dev));
for (i = 0; check_part[i]; i++) {
int res;
res = check_part[i](hd, bdev, first_sector, first_part_minor);
diff -urN S11/fs/partitions/msdos.c S11-part/fs/partitions/msdos.c
--- S11/fs/partitions/msdos.c Tue Oct 9 21:47:27 2001
+++ S11-part/fs/partitions/msdos.c Thu Oct 11 13:28:27 2001
@@ -103,21 +103,20 @@
*/

static void extended_partition(struct gendisk *hd, struct block_device *bdev,
- int minor, int *current_minor)
+ int minor, unsigned long first_size, int *current_minor)
{
struct partition *p;
Sector sect;
unsigned char *data;
- unsigned long first_sector, first_size, this_sector, this_size;
+ unsigned long first_sector, this_sector, this_size;
int mask = (1 << hd->minor_shift) - 1;
int sector_size = get_hardsect_size(to_kdev_t(bdev->bd_dev)) / 512;
int loopct = 0; /* number of links followed
without finding a data partition */
int i;

- first_sector = hd->part[minor].start_sect;
- first_size = hd->part[minor].nr_sects;
- this_sector = first_sector;
+ this_sector = first_sector = hd->part[minor].start_sect;
+ this_size = first_size;

while (1) {
if (++loopct > 100)
@@ -133,8 +132,6 @@

p = (struct partition *) (data + 0x1be);

- this_size = hd->part[minor].nr_sects;
-
/*
* Usually, the first entry is the real data partition,
* the 2nd entry is the next extended partition, or empty,
@@ -196,6 +193,7 @@
goto done; /* nothing left to do */

this_sector = first_sector + START_SECT(p) * sector_size;
+ this_size = NR_SECTS(p) * sector_size;
minor = *current_minor;
put_dev_sector(sect);
}
@@ -586,12 +584,13 @@
}
#endif
if (is_extended_partition(p)) {
+ unsigned long size = hd->part[minor].nr_sects;
printk(" <");
/* prevent someone doing mkfs or mkswap on an
extended partition, but leave room for LILO */
- if (hd->part[minor].nr_sects > 2)
+ if (size > 2)
hd->part[minor].nr_sects = 2;
- extended_partition(hd, bdev, minor, &current_minor);
+ extended_partition(hd, bdev, minor, size, &current_minor);
printk(" >");
}
}
diff -urN S11/include/linux/blkdev.h S11-part/include/linux/blkdev.h
--- S11/include/linux/blkdev.h Tue Oct 9 21:47:28 2001
+++ S11-part/include/linux/blkdev.h Thu Oct 11 11:30:01 2001
@@ -203,4 +203,27 @@
#define blk_finished_io(nsects) do { } while (0)
#define blk_started_io(nsects) do { } while (0)

+static inline unsigned int blksize_bits(unsigned int size)
+{
+ unsigned int bits = 8;
+ do {
+ bits++;
+ size >>= 1;
+ } while (size > 256);
+ return bits;
+}
+
+static inline unsigned int block_size(kdev_t dev)
+{
+ int retval = BLOCK_SIZE;
+ int major = MAJOR(dev);
+
+ if (blksize_size[major]) {
+ int minor = MINOR(dev);
+ if (blksize_size[major][minor])
+ retval = blksize_size[major][minor];
+ }
+ return retval;
+}
+
#endif


2001-10-11 22:33:51

by Christian Ullrich

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

* Alexander Viro wrote on Thursday, 2001-10-11:

> a) does 2.4.10-ac12 work for you? It had got essentially the same
> partition-related code that we have in 2.4.11. I suspect that causes
> of breakage are different, so the answer may not be the same for everybody
> affected.
>
> d) patch below closes two known holes. It's known to be not enough in
> one case (see above) and unlikely to help in another (sda9). However,
> let's get these holes out of the way first.

a) -10-ac11, -10-ac12 and -12 with your patch all behave like -11.

d) The patch does apparently not fix this particular bug.

--
Christian Ullrich Registrierter Linux-User #125183

"Sie k?nnen nach R'ed'mond fliegen -- aber Sie werden sterben"

2001-10-11 22:42:03

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

*Damn*. grok_partitions() doesn't set the size of entire device
until it's done with check_partition(). Which means max_blocks() behaving
in all sorts of interesting ways, depending on phase of moon, etc.

Could you check if the following helps?

diff -urN S11/fs/block_dev.c S11-part/fs/block_dev.c
--- S11/fs/block_dev.c Thu Oct 11 11:29:27 2001
+++ S11-part/fs/block_dev.c Thu Oct 11 15:50:52 2001
@@ -24,29 +24,6 @@

#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)

-static inline unsigned int blksize_bits(unsigned int size)
-{
- unsigned int bits = 8;
- do {
- bits++;
- size >>= 1;
- } while (size > 256);
- return bits;
-}
-
-static inline unsigned int block_size(kdev_t dev)
-{
- int retval = BLOCK_SIZE;
- int major = MAJOR(dev);
-
- if (blksize_size[major]) {
- int minor = MINOR(dev);
- if (blksize_size[major][minor])
- retval = blksize_size[major][minor];
- }
- return retval;
-}
-
static unsigned long max_block(kdev_t dev)
{
unsigned int retval = ~0U;
diff -urN S11/fs/partitions/check.c S11-part/fs/partitions/check.c
--- S11/fs/partitions/check.c Tue Oct 9 21:47:27 2001
+++ S11-part/fs/partitions/check.c Thu Oct 11 18:39:41 2001
@@ -247,6 +247,7 @@
printk(KERN_INFO " %s:", disk_name(hd, MINOR(dev), buf));
bdev = bdget(kdev_t_to_nr(dev));
bdev->bd_inode->i_size = (loff_t)hd->part[MINOR(dev)].nr_sects << 9;
+ bdev->bd_inode->i_blkbits = blksize_bits(block_size(dev));
for (i = 0; check_part[i]; i++) {
int res;
res = check_part[i](hd, bdev, first_sector, first_part_minor);
@@ -385,6 +386,12 @@
if (!size || minors == 1)
return;

+ if (dev->sizes) {
+ dev->sizes[first_minor] = size >> (BLOCK_SIZE_BITS - 9);
+ for (i = first_minor + 1; i < end_minor; i++)
+ dev->sizes[i] = 0;
+ }
+ blk_size[dev->major] = dev->sizes;
check_partition(dev, MKDEV(dev->major, first_minor), 1 + first_minor);

/*
@@ -394,7 +401,6 @@
if (dev->sizes != NULL) { /* optional safeguard in ll_rw_blk.c */
for (i = first_minor; i < end_minor; i++)
dev->sizes[i] = dev->part[i].nr_sects >> (BLOCK_SIZE_BITS - 9);
- blk_size[dev->major] = dev->sizes;
}
}

diff -urN S11/fs/partitions/msdos.c S11-part/fs/partitions/msdos.c
--- S11/fs/partitions/msdos.c Tue Oct 9 21:47:27 2001
+++ S11-part/fs/partitions/msdos.c Thu Oct 11 13:28:27 2001
@@ -103,21 +103,20 @@
*/

static void extended_partition(struct gendisk *hd, struct block_device *bdev,
- int minor, int *current_minor)
+ int minor, unsigned long first_size, int *current_minor)
{
struct partition *p;
Sector sect;
unsigned char *data;
- unsigned long first_sector, first_size, this_sector, this_size;
+ unsigned long first_sector, this_sector, this_size;
int mask = (1 << hd->minor_shift) - 1;
int sector_size = get_hardsect_size(to_kdev_t(bdev->bd_dev)) / 512;
int loopct = 0; /* number of links followed
without finding a data partition */
int i;

- first_sector = hd->part[minor].start_sect;
- first_size = hd->part[minor].nr_sects;
- this_sector = first_sector;
+ this_sector = first_sector = hd->part[minor].start_sect;
+ this_size = first_size;

while (1) {
if (++loopct > 100)
@@ -133,8 +132,6 @@

p = (struct partition *) (data + 0x1be);

- this_size = hd->part[minor].nr_sects;
-
/*
* Usually, the first entry is the real data partition,
* the 2nd entry is the next extended partition, or empty,
@@ -196,6 +193,7 @@
goto done; /* nothing left to do */

this_sector = first_sector + START_SECT(p) * sector_size;
+ this_size = NR_SECTS(p) * sector_size;
minor = *current_minor;
put_dev_sector(sect);
}
@@ -586,12 +584,13 @@
}
#endif
if (is_extended_partition(p)) {
+ unsigned long size = hd->part[minor].nr_sects;
printk(" <");
/* prevent someone doing mkfs or mkswap on an
extended partition, but leave room for LILO */
- if (hd->part[minor].nr_sects > 2)
+ if (size > 2)
hd->part[minor].nr_sects = 2;
- extended_partition(hd, bdev, minor, &current_minor);
+ extended_partition(hd, bdev, minor, size, &current_minor);
printk(" >");
}
}
diff -urN S11/include/linux/blkdev.h S11-part/include/linux/blkdev.h
--- S11/include/linux/blkdev.h Tue Oct 9 21:47:28 2001
+++ S11-part/include/linux/blkdev.h Thu Oct 11 11:30:01 2001
@@ -203,4 +203,27 @@
#define blk_finished_io(nsects) do { } while (0)
#define blk_started_io(nsects) do { } while (0)

+static inline unsigned int blksize_bits(unsigned int size)
+{
+ unsigned int bits = 8;
+ do {
+ bits++;
+ size >>= 1;
+ } while (size > 256);
+ return bits;
+}
+
+static inline unsigned int block_size(kdev_t dev)
+{
+ int retval = BLOCK_SIZE;
+ int major = MAJOR(dev);
+
+ if (blksize_size[major]) {
+ int minor = MINOR(dev);
+ if (blksize_size[major][minor])
+ retval = blksize_size[major][minor];
+ }
+ return retval;
+}
+
#endif

2001-10-11 22:58:52

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11



On Fri, 12 Oct 2001, Christian Ullrich wrote:

> a) -10-ac11, -10-ac12 and -12 with your patch all behave like -11.

_Ouch_. So even bread()-based variant fails to read extended partition
table in some cases.

Hmm... Just in case - what processor are you using?

2001-10-11 23:04:03

by Christian Ullrich

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

* Alexander Viro wrote on Thursday, 2001-10-11:

> On Fri, 12 Oct 2001, Christian Ullrich wrote:
>
> > a) -10-ac11, -10-ac12 and -12 with your patch all behave like -11.
>
> _Ouch_. So even bread()-based variant fails to read extended partition
> table in some cases.
>
> Hmm... Just in case - what processor are you using?

Full dmesg output from 2.4.10:

Linux version 2.4.10 (root@christian) (gcc version 2.95.3 20010315 (SuSE)) #1 Fri Oct 12 00:13:47 CEST 2001
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003ffec000 (usable)
BIOS-e820: 000000003ffec000 - 000000003ffef000 (ACPI data)
BIOS-e820: 000000003ffef000 - 000000003ffff000 (reserved)
BIOS-e820: 000000003ffff000 - 0000000040000000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
On node 0 totalpages: 262124
zone(0): 4096 pages.
zone(1): 225280 pages.
zone(2): 32748 pages.
Kernel command line: auto BOOT_IMAGE=L ro root=802 BOOT_FILE=/boot/vmlinuz-2.4.10+line 3 2.4.10+l 2
Initializing CPU#0
Detected 1208.772 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 2411.72 BogoMIPS
Memory: 1029868k/1048496k available (678k kernel code, 18240k reserved, 164k data, 168k init, 130992k highmem)
Dentry-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
Buffer-cache hash table entries: 65536 (order: 6, 262144 bytes)
Page-cache hash table entries: 262144 (order: 8, 1048576 bytes)
CPU: Before vendor init, caps: 0183f9ff c1c7f9ff 00000000, vendor = 2
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU: After vendor init, caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: After generic, caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: Common caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: AMD Athlon(tm) Processor stepping 02
Enabling fast FPU save and restore... done.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.40 (20010327) Richard Gooch ([email protected])
mtrr: detected mtrr type: Intel
PCI: PCI BIOS revision 2.10 entry at 0xf1180, last bus=1
PCI: Using configuration type 1
PCI: Probing PCI hardware
Unknown bridge resource 0: assuming transparent
PCI: Using IRQ router VIA [1106/0686] at 00:04.0
PCI: Found IRQ 10 for device 00:0b.0
PCI: Sharing IRQ 10 with 00:11.0
Applying VIA southbridge workaround.
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd
allocated 32 pages and 32 bhs reserved for the highmem bounces
pty: 256 Unix98 ptys configured
block: 128 slots per queue, batch=16
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 8192 buckets, 64Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 599k freed
VFS: Mounted root (ext2 filesystem).
SCSI subsystem driver Revision: 1.00
PCI: Found IRQ 11 for device 00:0c.0
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.1
<Adaptec 2940 Ultra SCSI adapter>
aic7880: Ultra Wide Channel A, SCSI Id=7, 16/255 SCBs

Vendor: IBM Model: DNES-309170W Rev: SAH0
Type: Direct-Access ANSI SCSI revision: 03
(scsi0:A:0): 40.000MB/s transfers (20.000MHz, offset 8, 16bit)
Vendor: PIONEER Model: DVD-ROM DVD-305 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 02
(scsi0:A:2): 20.000MB/s transfers (20.000MHz, offset 15)
Vendor: YAMAHA Model: CRW4416S Rev: 1.0g
Type: CD-ROM ANSI SCSI revision: 02
(scsi0:A:3): 8.333MB/s transfers (8.333MHz, offset 15)
Vendor: IBM Model: DNES-309170W Rev: SA30
Type: Direct-Access ANSI SCSI revision: 03
(scsi0:A:6): 40.000MB/s transfers (20.000MHz, offset 8, 16bit)
scsi0:0:0:0: Tagged Queuing enabled. Depth 8
scsi0:0:6:0: Tagged Queuing enabled. Depth 8
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi0, channel 0, id 6, lun 0
SCSI device sda: 17916240 512-byte hdwr sectors (9173 MB)
Partition check:
sda:[63 16002]
sda1[16065 401625]
sda2[417690 8401995]
sda3[8819685 9092790]
sda4 <[8819748 5253192]
sda5[14073003 273042]
sda6[14346108 995967]
sda7[15342138 2570337]
sda8 >
SCSI device sdb: 17916240 512-byte hdwr sectors (9173 MB)
sdb:[63 10490382]
sdb1[10490445 7164990]
sdb2[17655435 257040]
sdb4
reiserfs: checking transaction log (device 08:02) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
VFS: Mounted root (reiserfs filesystem) readonly.
change_root: old root has d_count=2
Trying to unmount old root ... okay
Freeing unused kernel memory: 168k freed
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Adding Swap: 136512k swap-space (priority -1)
Adding Swap: 128512k swap-space (priority -2)
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller on PCI bus 00 dev 21
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:04.1
ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:pio
PDC20265: IDE controller on PCI bus 00 dev 88
PCI: Found IRQ 10 for device 00:11.0
PCI: Sharing IRQ 10 with 00:0b.0
PDC20265: chipset revision 2
PDC20265: not 100% native mode: will probe irqs later
ide2: BM-DMA at 0x7800-0x7807, BIOS settings: hde:pio, hdf:pio
ide3: BM-DMA at 0x7808-0x780f, BIOS settings: hdg:pio, hdh:pio
hda: QUANTUM FIREBALLlct20 20, ATA DISK drive
hdb: FUJITSU MPG3409AT E, ATA DISK drive
hdc: Pioneer DVD-ROM ATAPIModel DVD-105S 012, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 39876480 sectors (20417 MB) w/418KiB Cache, CHS=39560/16/63, UDMA(100)
hdb: 80063424 sectors (40992 MB) w/2048KiB Cache, CHS=79428/16/63, UDMA(100)
hda:[63 2104452]
hda1[2104515 37768815]
hda2 <[2104578 20980827]
hda5[23085468 48132]
hda6[23133663 16739667]
hda7 >
hdb:[63 10000305]
hdb1[10000368 68063184]
hdb2 <[10000431 20972889]
hdb5[48063519 30000033]
hdb6 >[78063552 1999872]
hdb3
Adding Swap: 999928k swap-space (priority -3)
reiserfs: checking transaction log (device 08:03) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:05) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:07) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:11) ...
Using tea hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:08) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:12) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 03:46) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
ip_conntrack (8191 buckets, 65528 max)
PCI: Found IRQ 5 for device 00:09.0
PCI: Sharing IRQ 5 with 00:04.2
PCI: Sharing IRQ 5 with 00:04.3
3c59x: Donald Becker and others. http://www.scyld.com/network/vortex.html
00:09.0: 3Com PCI 3c905C Tornado at 0xa400. Vers LK1.1.16

----------------------------------------------------------------------------

Full dmesg output from 2.4.12+first-patch+line:

Linux version 2.4.12 (root@christian) (gcc version 2.95.3 20010315 (SuSE)) #1 Don Okt 11 23:51:44 CEST 2001
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003ffec000 (usable)
BIOS-e820: 000000003ffec000 - 000000003ffef000 (ACPI data)
BIOS-e820: 000000003ffef000 - 000000003ffff000 (reserved)
BIOS-e820: 000000003ffff000 - 0000000040000000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
On node 0 totalpages: 262124
zone(0): 4096 pages.
zone(1): 225280 pages.
zone(2): 32748 pages.
Kernel command line: auto BOOT_IMAGE=L ro root=802 BOOT_FILE=/boot/vmlinuz-2.4.12+patch+line 3 2.4.12+p+l 2
Initializing CPU#0
Detected 1208.767 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 2411.72 BogoMIPS
Memory: 1029868k/1048496k available (674k kernel code, 18240k reserved, 164k data, 172k init, 130992k highmem)
Dentry-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
Buffer-cache hash table entries: 65536 (order: 6, 262144 bytes)
Page-cache hash table entries: 262144 (order: 8, 1048576 bytes)
CPU: Before vendor init, caps: 0183f9ff c1c7f9ff 00000000, vendor = 2
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU: After vendor init, caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: After generic, caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: Common caps: 0183f9ff c1c7f9ff 00000000 00000000
CPU: AMD Athlon(tm) Processor stepping 02
Enabling fast FPU save and restore... done.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.40 (20010327) Richard Gooch ([email protected])
mtrr: detected mtrr type: Intel
PCI: PCI BIOS revision 2.10 entry at 0xf1180, last bus=1
PCI: Using configuration type 1
PCI: Probing PCI hardware
Trying to stomp on Athlon bug...
Unknown bridge resource 0: assuming transparent
PCI: Using IRQ router VIA [1106/0686] at 00:04.0
PCI: Found IRQ 10 for device 00:0b.0
PCI: Sharing IRQ 10 with 00:11.0
Applying VIA southbridge workaround.
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd
allocated 32 pages and 32 bhs reserved for the highmem bounces
pty: 256 Unix98 ptys configured
block: 128 slots per queue, batch=16
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 8192 buckets, 64Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 603k freed
VFS: Mounted root (ext2 filesystem).
SCSI subsystem driver Revision: 1.00
PCI: Found IRQ 11 for device 00:0c.0
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.1
<Adaptec 2940 Ultra SCSI adapter>
aic7880: Ultra Wide Channel A, SCSI Id=7, 16/255 SCBs

Vendor: IBM Model: DNES-309170W Rev: SAH0
Type: Direct-Access ANSI SCSI revision: 03
(scsi0:A:0): 40.000MB/s transfers (20.000MHz, offset 8, 16bit)
Vendor: PIONEER Model: DVD-ROM DVD-305 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 02
(scsi0:A:2): 20.000MB/s transfers (20.000MHz, offset 15)
Vendor: YAMAHA Model: CRW4416S Rev: 1.0g
Type: CD-ROM ANSI SCSI revision: 02
(scsi0:A:3): 8.333MB/s transfers (8.333MHz, offset 15)
Vendor: IBM Model: DNES-309170W Rev: SA30
Type: Direct-Access ANSI SCSI revision: 03
(scsi0:A:6): 40.000MB/s transfers (20.000MHz, offset 8, 16bit)
scsi0:0:0:0: Tagged Queuing enabled. Depth 8
scsi0:0:6:0: Tagged Queuing enabled. Depth 8
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi0, channel 0, id 6, lun 0
SCSI device sda: 17916240 512-byte hdwr sectors (9173 MB)
Partition check:
sda:[63 16002]
sda1[16065 401625]
sda2[417690 8401995]
sda3[8819685 9092790]
sda4 <[8819748 5253192]
sda5[14073003 273042]
sda6[14346108 995967]
sda7[15342138 2570337]
sda8 >
SCSI device sdb: 17916240 512-byte hdwr sectors (9173 MB)
sdb:[63 10490382]
sdb1[10490445 7164990]
sdb2[17655435 257040]
sdb4
reiserfs: checking transaction log (device 08:02) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
VFS: Mounted root (reiserfs filesystem) readonly.
change_root: old root has d_count=2
Trying to unmount old root ... okay
Freeing unused kernel memory: 172k freed
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Adding Swap: 136512k swap-space (priority -1)
Adding Swap: 128512k swap-space (priority -2)
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller on PCI bus 00 dev 21
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:04.1
ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:pio
PDC20265: IDE controller on PCI bus 00 dev 88
PCI: Found IRQ 10 for device 00:11.0
PCI: Sharing IRQ 10 with 00:0b.0
PDC20265: chipset revision 2
PDC20265: not 100% native mode: will probe irqs later
ide2: BM-DMA at 0x7800-0x7807, BIOS settings: hde:pio, hdf:pio
ide3: BM-DMA at 0x7808-0x780f, BIOS settings: hdg:pio, hdh:pio
hda: QUANTUM FIREBALLlct20 20, ATA DISK drive
hdb: FUJITSU MPG3409AT E, ATA DISK drive
hdc: Pioneer DVD-ROM ATAPIModel DVD-105S 012, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 39876480 sectors (20417 MB) w/418KiB Cache, CHS=39560/16/63, UDMA(100)
hdb: 80063424 sectors (40992 MB) w/2048KiB Cache, CHS=79428/16/63, UDMA(100)
hda:[63 2104452]
hda1[2104515 37768815]
hda2 <[2104578 20980827]
hda5[23085468 48132]
hda6[23133663 16739667]
hda7 >
hdb:[63 10000305]
hdb1[10000368 68063184]
hdb2 < >[78063552 1999872]
hdb3
Adding Swap: 999928k swap-space (priority -3)
reiserfs: checking transaction log (device 08:03) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:05) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:07) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:11) ...
Using tea hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:08) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
reiserfs: checking transaction log (device 08:12) ...
Using r5 hash to sort names
reiserfs: using 3.5.x disk format
ReiserFS version 3.6.25
hdb6: bad access: block=128, count=2
end_request: I/O error, dev 03:46 (hdb), sector 128
read_super_block: bread failed (dev 03:46, block 64, size 1024)
hdb6: bad access: block=16, count=2
end_request: I/O error, dev 03:46 (hdb), sector 16
read_super_block: bread failed (dev 03:46, block 8, size 1024)
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
ip_conntrack (8191 buckets, 65528 max)
PCI: Found IRQ 5 for device 00:09.0
PCI: Sharing IRQ 5 with 00:04.2
PCI: Sharing IRQ 5 with 00:04.3
3c59x: Donald Becker and others. http://www.scyld.com/network/vortex.html
00:09.0: 3Com PCI 3c905C Tornado at 0xa400. Vers LK1.1.16

--
Christian Ullrich Registrierter Linux-User #125183

"Sie k?nnen nach R'ed'mond fliegen -- aber Sie werden sterben"

2001-10-11 23:09:23

by Christian Ullrich

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

* Alexander Viro wrote on Thursday, 2001-10-11:

> *Damn*. grok_partitions() doesn't set the size of entire device
> until it's done with check_partition(). Which means max_blocks() behaving
> in all sorts of interesting ways, depending on phase of moon, etc.
>
> Could you check if the following helps?

Yeah, that one did it.

dmesg (only the interesting parts):

hdb:[63 10000305]
hdb1[10000368 68063184]
hdb2 <[10000431 20972889]
hdb5[48063519 30000033]
hdb6 >[78063552 1999872]
hdb3

reiserfs: checking transaction log (device 03:46) ...
Using r5 hash to sort names
ReiserFS version 3.6.25
(this time, no errors to follow)


--
Christian Ullrich Registrierter Linux-User #125183

"Sie k?nnen nach R'ed'mond fliegen -- aber Sie werden sterben"

2001-10-11 23:10:53

by Jeff Garzik

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

On Fri, 12 Oct 2001, Christian Ullrich wrote:
[...]
> zone(0): 4096 pages.
> zone(1): 225280 pages.
> zone(2): 32748 pages.
[...]
> Memory: 1029868k/1048496k available (678k kernel code, 18240k reserved, 164k data, 168k init, 130992k highmem)
> Dentry-cache hash table entries: 131072 (order: 8, 1048576 bytes)
> Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
> Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
> Buffer-cache hash table entries: 65536 (order: 6, 262144 bytes)
> Page-cache hash table entries: 262144 (order: 8, 1048576 bytes)

To tangent, do we really need a mount cache that big, even on a highmem
machine?

Jeff




2001-10-11 23:18:54

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11



On Fri, 12 Oct 2001, Christian Ullrich wrote:

> * Alexander Viro wrote on Thursday, 2001-10-11:
>
> > *Damn*. grok_partitions() doesn't set the size of entire device
> > until it's done with check_partition(). Which means max_blocks() behaving
> > in all sorts of interesting ways, depending on phase of moon, etc.
> >
> > Could you check if the following helps?
>
> Yeah, that one did it.

Good. What about other two cases? I'm pretty sure that one of them
(sda9) is actually an invalid partition table and had worked only
by accident, but another may very well be fixed by that.

2001-10-11 23:22:24

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11



On Thu, 11 Oct 2001, Jeff Garzik wrote:

> To tangent, do we really need a mount cache that big, even on a highmem
> machine?

Probably not - feel free to cut it down. Anything larger than about
a thousand vfsmounts (on a box with a lot of bindings and several
chroot environment playing interesting games) is an overkill...

2001-10-11 23:27:24

by David Miller

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

From: Jeff Garzik <[email protected]>
Date: Thu, 11 Oct 2001 18:10:43 -0500 (CDT)

> Page-cache hash table entries: 262144 (order: 8, 1048576 bytes)

To tangent, do we really need a mount cache that big, even on a highmem
machine?

Yes, in fact on machines with 16GB or so of ram we perform poorly due
to the 4MB size restriction from GFP() allocations. Anton Blanchard
hit this on large PPC64 SMP machines already.

On a 16GB or 32GB ram machine, the hash chains go to 20 deep even on
simple benchmarks and all performance goes to the toilet.

Franks a lot,
David S. Miller
[email protected]

2001-10-11 23:28:14

by David Miller

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

From: Alexander Viro <[email protected]>
Date: Thu, 11 Oct 2001 19:22:25 -0400 (EDT)

On Thu, 11 Oct 2001, Jeff Garzik wrote:

> To tangent, do we really need a mount cache that big, even on a highmem
> machine?

Probably not - feel free to cut it down.

Yikes, ignore my previous email, I misread and thought Jeff was
talking about the page cache hashes :)

Franks a lot,
David S. Miller
[email protected]

2001-10-11 23:30:54

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

Rediffed against 13-pre1:
--- linux/fs/partitions/check.c Thu Oct 11 19:25:03 2001
+++ linux/fs/partitions/check.c.fixed Thu Oct 11 18:39:41 2001
@@ -386,6 +386,12 @@
if (!size || minors == 1)
return;

+ if (dev->sizes) {
+ dev->sizes[first_minor] = size >> (BLOCK_SIZE_BITS - 9);
+ for (i = first_minor + 1; i < end_minor; i++)
+ dev->sizes[i] = 0;
+ }
+ blk_size[dev->major] = dev->sizes;
check_partition(dev, MKDEV(dev->major, first_minor), 1 + first_minor);

/*
@@ -395,7 +401,6 @@
if (dev->sizes != NULL) { /* optional safeguard in ll_rw_blk.c */
for (i = first_minor; i < end_minor; i++)
dev->sizes[i] = dev->part[i].nr_sects >> (BLOCK_SIZE_BITS - 9);
- blk_size[dev->major] = dev->sizes;
}
}



2001-10-11 23:34:35

by Stephan von Krawczynski

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

On Thu, 11 Oct 2001 18:59:03 -0400 (EDT) Alexander Viro <[email protected]>
wrote:

>
>
> On Fri, 12 Oct 2001, Christian Ullrich wrote:
>
> > a) -10-ac11, -10-ac12 and -12 with your patch all behave like -11.
>
> _Ouch_. So even bread()-based variant fails to read extended partition
> table in some cases.
>
> Hmm... Just in case - what processor are you using?

Hi Alexander,

just a short comment: I got a host with PIII-500 and the same problem. A
partition on primary IDE (single partition for whole drive) vanished during use
of 2.4.10(SuSE 7.3)/11. System works flawlessly otherwise. It is booting from
SCSI, ide was only data :-). It has 384 MB RAM.

Regards,
Stephan

2001-10-11 23:43:56

by Alexander Viro

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11



On Fri, 12 Oct 2001, Stephan von Krawczynski wrote:

> Hi Alexander,
>
> just a short comment: I got a host with PIII-500 and the same problem. A
> partition on primary IDE (single partition for whole drive) vanished during use
> of 2.4.10(SuSE 7.3)/11. System works flawlessly otherwise. It is booting from
> SCSI, ide was only data :-). It has 384 MB RAM.

Try the patch against 2.4.13-pre1 posted in that thread.

2001-10-11 23:55:37

by Alexander Viro

[permalink] [raw]
Subject: [PATCH] Partitioning problems in 2.4.11

Patches are on ftp.math.psu.edu/pub/viro - one against -ac is
A0-partition-AC10-12 and one against Linus' tree is A0-partition-S13-pre1.

If you've got missing partitions syndrome - check these. If they don't
fix the problem - please, tell.

2001-10-12 10:21:26

by Vincent Sweeney

[permalink] [raw]
Subject: Re: Partitioning problems in 2.4.11

Yes, this patch also fixed my missing IDE partition problem.

Christian Ullrich wrote:
>
> * Alexander Viro wrote on Thursday, 2001-10-11:
>
> > *Damn*. grok_partitions() doesn't set the size of entire device
> > until it's done with check_partition(). Which means max_blocks() behaving
> > in all sorts of interesting ways, depending on phase of moon, etc.
> >
> > Could you check if the following helps?
>
> Yeah, that one did it.
>
> dmesg (only the interesting parts):
>
> hdb:[63 10000305]
> hdb1[10000368 68063184]
> hdb2 <[10000431 20972889]
> hdb5[48063519 30000033]
> hdb6 >[78063552 1999872]
> hdb3
>
> reiserfs: checking transaction log (device 03:46) ...
> Using r5 hash to sort names
> ReiserFS version 3.6.25
> (this time, no errors to follow)
>
> --
> Christian Ullrich Registrierter Linux-User #125183
>
> "Sie k?nnen nach R'ed'mond fliegen -- aber Sie werden sterben"
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/