/proc/partitions hosed in 2.4.9-ac10
[----------snip----------]
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.1
<Adaptec 2940 Ultra SCSI adapter>
aic7880: Ultra Single Channel A, SCSI Id=7, 16/255 SCBs
(scsi0:A:4): 10.000MB/s transfers (10.000MHz, offset 15)
Vendor: OLYMPUS Model: MOS364 Rev: 1.02
Type: Optical Device ANSI SCSI revision: 02
(scsi0:A:5): 10.000MB/s transfers (10.000MHz, offset 15)
Vendor: OLYMPUS Model: MOS364 Rev: 1.02
Type: Optical Device ANSI SCSI revision: 02
[----------snip----------]
Attached scsi removable disk sda at scsi0, channel 0, id 4, lun 0 Attached scsi removable disk sdb at scsi0, channel 0, id 5, lun 0 SCSI device sda: 310352 2048-byte hdwr sectors (636 MB)
sda: Write Protect is off
sda:<5>ll_rw_block: device 08:00: only 2048-char blocks implemented (1024) unable to read boot sectors / partition sectors
SCSI device sdb: 310352 2048-byte hdwr sectors (636 MB)
sdb: Write Protect is off
sdb:<5>ll_rw_block: device 08:10: only 2048-char blocks implemented (1024) unable to read boot sectors / partition sectors
[----------snip----------]
$ cat /proc/partitions major minor #blocks name
8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb
<continues forever>
In this case, there is no partition table on the magneto optical media (since there seems little reason for such things)
$ fdisk -l /dev/sda
Note: sector size is 2048 (not 512) Disk /dev/sda: 64 heads, 32 sectors, 151 cylinders Units = cylinders of 2048 * 2048 bytes
Disk /dev/sda doesn't contain a valid partition table $
$ file -s /dev/sda
/dev/sda: Linux rev 1.0 ext2 filesystem data
-Erik
--
Erik B. Andersen email: [email protected], formerly of Lineo
--This message was written using 73% post-consumer electrons--
Quoted 17 lines · Erik Andersen
$ cat /proc/partitions major minor #blocks name8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb 8 0 620704 sda 8 16 620704 sdb
Quoted 2 lines
<continues forever>
Reverting drivers/scsi/sd.c to stock 2.4.9 fixes it, BTW,
-Erik
--
Erik B. Andersen email: [email protected], formerly of Lineo
--This message was written using 73% post-consumer electrons--
Quoted 2 lines · In article <[email protected]> you wrote:
[----------snip----------]
[----------snip----------]
Could you please try the attached patch agains 2.4.10-pre10?
drivers/scsi/sd.c renamed from master/linux-2.4.10-pre10/drivers/scsi/sd.c +29 -44
@@ -557,22 +557,7 @@ revalidate: fop_revalidate_scsidisk }; -/* -* If we need more than one SCSI disk major (i.e. more than -* 16 SCSI disks), we'll have to kmalloc() more gendisks later. -*/ - -static struct gendisk sd_gendisk = -{ - major:SCSI_DISK0_MAJOR , - major_name:"sd" , - minor_shift:4 , - max_p:1 <<4 , - fops: &sd_fops, -}; - -static struct gendisk *sd_gendisks = &sd_gendisk; - +static struct gendisk *sd_gendisks;#define SD_GENDISK (i) sd_gendisks[(i) / SCSI_DISKS_PER_MAJOR]/*
@@ -1132,33 +1117,34 @@ goto cleanup_sd;memset (sd,0 , (sd_template.dev_max <<4 ) *sizeof (struct hd_struct )); -if (N_USED_SD_MAJORS >1 ) - sd_gendisks =kmalloc (N_USED_SD_MAJORS *sizeof (struct gendisk ),GFP_ATOMIC ); -if (!sd_gendisks) - goto cleanup_sd_gendisks; + sd_gendisks =kmalloc (N_USED_SD_MAJORS *sizeof (struct gendisk ),GFP_ATOMIC ); +if (!sd_gendisks) + goto cleanup_sd_gendisks; +for (i =0 ; i <N_USED_SD_MAJORS ; i++) { - sd_gendisks[i] = sd_gendisk; - sd_gendisks[i].de_arr =kmalloc (SCSI_DISKS_PER_MAJOR *sizeof *sd_gendisks[i].de_arr, -GFP_ATOMIC ); -if (!sd_gendisks[i].de_arr) +struct gendisk *g = &sd_gendisks[i]; + + g->de_arr =kmalloc (SCSI_DISKS_PER_MAJOR *sizeof (*g->de_arr), +GFP_ATOMIC ); +if (!g->de_arr) goto cleanup_gendisks_de_arr; -memset (sd_gendisks[i].de_arr,0 , -SCSI_DISKS_PER_MAJOR *sizeof *sd_gendisks[i].de_arr); - sd_gendisks[i].flags =kmalloc (SCSI_DISKS_PER_MAJOR *sizeof *sd_gendisks[i].flags, -GFP_ATOMIC ); -if (!sd_gendisks[i].flags) +memset (g->de_arr,0 ,SCSI_DISKS_PER_MAJOR *sizeof (*g->de_arr)); + + g->flags =kmalloc (SCSI_DISKS_PER_MAJOR * +sizeof (*g->flags),GFP_ATOMIC ); +if (!g->flags) goto cleanup_gendisks_flags; -memset (sd_gendisks[i].flags,0 , -SCSI_DISKS_PER_MAJOR *sizeof *sd_gendisks[i].flags); - sd_gendisks[i].major =SD_MAJOR (i); - sd_gendisks[i].major_name ="sd" ; - sd_gendisks[i].minor_shift =4 ; - sd_gendisks[i].max_p =1 <<4 ; - sd_gendisks[i].part = sd + (i *SCSI_DISKS_PER_MAJOR <<4 ); - sd_gendisks[i].sizes = sd_sizes + (i *SCSI_DISKS_PER_MAJOR <<4 ); - sd_gendisks[i].nr_real =0 ; - sd_gendisks[i].real_devices = - (void *) (rscsi_disks + i *SCSI_DISKS_PER_MAJOR ); +memset (g->flags,0 ,SCSI_DISKS_PER_MAJOR *sizeof (*g->flags)); + + g->major =SD_MAJOR (i); + g->major_name ="sd" ; + g->minor_shift =4 ; + g->max_p =1 << g->minor_shift; + g->part = sd + (i *SCSI_DISKS_PER_MAJOR <<4 ); + g->sizes = sd_sizes + (i *SCSI_DISKS_PER_MAJOR <<4 ); + g->nr_real =0 ; + g->real_devices = (rscsi_disks + i *SCSI_DISKS_PER_MAJOR ); + g->fops = &sd_fops; }return 0 ;
@@ -1348,8 +1334,8 @@/* If we are disconnecting a disk driver, sync and invalidate * everything */ - max_p = sd_gendisk.max_p; - start = i << sd_gendisk.minor_shift; + max_p = sd_gendisks->max_p; + start = i << sd_gendisks->minor_shift;for (j = max_p -1 ; j >=0 ; j--) {int index = start + j;
@@ -1403,8 +1389,7 @@ read_ahead[SD_MAJOR (i)] =0 ; } sd_template.dev_max =0 ; -if (sd_gendisks != &sd_gendisk) -kfree (sd_gendisks); +kfree (sd_gendisks); }module_init (init_sd);
Quoted 2 lines · Colonel
Works fine here:
But none of your devices have 2048 byte physical sectors, which is the case with my MO drives, and that appears to be the root of the problem,
-Erik
--
Erik B. Andersen email: [email protected], formerly of Lineo
--This message was written using 73% post-consumer electrons--
I have the problem as well, and my physical sector size is 512. I'll try the patch
Quoted 23 lines · Erik Andersen
Quoted 2 lines · Colonel
Works fine here:
But none of your devices have 2048 byte physical sectors, which is the case with my MO drives, and that appears to be the root of the problem,
-Erik
--
Erik B. Andersen email: [email protected], formerly of Lineo --This message was written using 73% post-consumer electrons-- -
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/
Hi,
Quoted 7 lines · Erik Andersen
Quoted 2 lines · Colonel
Works fine here:
But none of your devices have 2048 byte physical sectors, which is the case with my MO drives, and that appears to be the root of the problem,
No, the problem only seems to exist when the low level SCSI drivers are being used as modules, not linked into the kernel.
Just tried it with 2.4.10-pre10: sym53c8xx and aic7xxx loaded as module ==> "cat /proc/partitions" gives infinite output (and my /dev/hda does not show up at all). Both drivers compiled into the kernel ==> everything is fine; even my /dev/hda shows up.
Quoted 1 line
-Erik
-o)
Hubert Mantel Goodbye, dots... /\\
_\_vHi,
Quoted 1 line · Christoph Hellwig
Could you please try the attached patch agains 2.4.10-pre10?
Tried it. Does not help.
-o)
Hubert Mantel Goodbye, dots... /\\
_\_vHi,
Quoted 1 line · Colonel
Quoted 1 line
$ cat /proc/partitions
[...]
Quoted 1 line
Works fine here:
[...]
Quoted 8 lines
SCSI subsystem driver Revision: 1.00
sym53c8xx: at PCI bus 0, device 9, function 0
sym53c8xx: setting PCI_COMMAND_PARITY...(fix-up)
sym53c8xx: 53c875 detected with Symbios NVRAM
sym53c8xx: at PCI bus 0, device 9, function 1Perhaps it is a driver effect?
You only have one single SCSI adapter?
I tried several things so far, and it seems you need the following to trigger the problem: You need at least two SCSI adapters that require different drivers (so two AHA2940s are not sufficient) and the drivers need to be loaded as modules.
-o)
Hubert Mantel Goodbye, dots... /\\
_\_vQuoted 19 lines · Hubert Mantel [[email protected]] wrote:
Hi,
Quoted 1 line · Colonel
Quoted 1 line
$ cat /proc/partitions[...]
Quoted 1 line
Works fine here:
[...]
Quoted 7 lines
SCSI subsystem driver Revision: 1.00
sym53c8xx: at PCI bus 0, device 9, function 0
sym53c8xx: setting PCI_COMMAND_PARITY...(fix-up)
sym53c8xx: 53c875 detected with Symbios NVRAM
sym53c8xx: at PCI bus 0, device 9, function 1
Quoted 8 lines
Quoted 1 line
Perhaps it is a driver effect?
You only have one single SCSI adapter?
I tried several things so far, and it seems you need the following to trigger the problem: You need at least two SCSI adapters that require different drivers (so two AHA2940s are not sufficient) and the drivers need to be loaded as modules.
I have a BusLogic BT-958 (compiled in), pas16 (module), and usb-storage (module).
The problem shows up with only the BusLogic scsi device, and the other modules not loaded. (And it also shows up with 2 or more scsi drivers loaded) Note that on this machine the pas16 and usb-storage modules *were* installed, I removed them, and /proc/partitions still looped. (I can't readily reboot ATM)
Hope this helps,
-- Bob
Bob McElrath ([email protected]) Univ. of Wisconsin at Madison, Department of Physics
Quoted 8 lines · Hubert Mantel
Quoted 8 lines
You only have one single SCSI adapter?
I tried several things so far, and it seems you need the following to trigger the problem: You need at least two SCSI adapters that require different drivers (so two AHA2940s are not sufficient) and the drivers need to be loaded as modules.
-o)
I would amend that a bit - it doesn't seem to have to be only two SCSI drivers, because I've seen the same with a 2.4.9-ac9 system with aic7xxx (with sg, sd, and sr) combined with usb-storage (which also uses sd). Granted usb-storage is kinda pseudo-SCSI, but it's not truly a SCSI low level driver.
tw
Signature · 1 line
[email protected]
Quoted 7 lines · Hubert Mantel
Hi,
Quoted 1 line · Christoph Hellwig
Could you please try the attached patch agains 2.4.10-pre10?
Tried it. Does not help.
Can you verify that 2.4.9-ac8+ shows the bug as well?
Christoph
Signature · 1 line
Whip me. Beat me. Make me maintain AIX.
Quoted 11 lines · Tim Walberg
Quoted 8 lines · Hubert Mantel
Quoted 8 lines
You only have one single SCSI adapter?
I tried several things so far, and it seems you need the following to trigger the problem: You need at least two SCSI adapters that require different drivers (so two AHA2940s are not sufficient) and the drivers need to be loaded as modules.
-o)
Quoted 7 lines
I would amend that a bit - it doesn't seem to have to be only two SCSI drivers, because I've seen the same with a 2.4.9-ac9 system with aic7xxx (with sg, sd, and sr) combined with usb-storage (which also uses sd). Granted usb-storage is kinda pseudo-SCSI, but it's not truly a SCSI low level driver.
tw
As a datapoint: I have seen this when I "scsi remove-single-device"'d a disk from my system. After re-adding it (at the same ID/LUN etc. in this case) /proc/partitions was OK again.
Two different Adaptec controllers driven by AIC7xxx, compiled into kernel, no modules.
Thorsten
Signature · 3 lines
| Thorsten Kranzkowski Internet: [email protected] | | Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |