Skip to contentSkip to conversation

2.6.11rc2 prints disksize twice

DISCUSSION Olaf Hering 2 participants 2 messages Jan 31, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

I think its not a functional problem,
but parts of the disk detection is printed twice.

...
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
...

Loading sym0: <1010-66> rev 0x1 at pci 0000:41:01.0 irq 103 kernel/drivers/ssym0: No NVRAM, ID 7, Fast-80, LVD, parity checking csi/scsi_mod.ko
Loading kernel/drivers/scsi/sdsym0: SCSI BUS has been reset. _mod.ko
Loadingscsi0 : sym-2.1.18n
kernel/drivers/scsi/sr_mod.ko
Loading kernel/drivers/scsi/scsi_transport_spi.ko Loading kernel/drivers/scsi/sym53c8xx_2/sym53c8xx.ko sym0:8: FAST-40 WIDE SCSI 80.0 MB/s ST (25.0 ns, offset 31)
Vendor: IBM Model: IC35L036UCDY10-0 Rev: S28C
Type: Direct-Access ANSI SCSI revision: 03
sym0:8:0: tagged command queuing enabled, command queue depth 16.
target0:0:8: Beginning Domain Validation
sym0:8: asynchronous.
sym0:8: wide asynchronous.
sym0:8: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 31)
target0:0:8: Ending Domain Validation
SCSI device sda: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sda: drive cache: write through
SCSI device sda: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sda: drive cache: write through
sda: sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 8, lun 0 sym0:9: FAST-40 WIDE SCSI 80.0 MB/s ST (25.0 ns, offset 31)
Vendor: IBM Model: IC35L036UCDY10-0 Rev: S28C
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9: asynchronous.
sym0:9: wide asynchronous.
sym0:9: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 31)
target0:0:9: Ending Domain Validation
SCSI device sdb: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdb: drive cache: write through
SCSI device sdb: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdb: drive cache: write through
sdb: sdb1 sdb2 sdb3
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0 sym0:10: FAST-40 WIDE SCSI 80.0 MB/s ST (25.0 ns, offset 31)
Vendor: IBM Model: IC35L036UCDY10-0 Rev: S28C
Type: Direct-Access ANSI SCSI revision: 03
sym0:10:0: tagged command queuing enabled, command queue depth 16.
target0:0:10: Beginning Domain Validation
sym0:10: asynchronous.
sym0:10: wide asynchronous.
sym0:10: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 31)
target0:0:10: Ending Domain Validation
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
sdc: sdc1 sdc2 sdc3
Attached scsi disk sdc at scsi0, channel 0, id 10, lun 0
Vendor: IBM Model: HSBPD4E PU3SCSI Rev: 0016
Type: Enclosure ANSI SCSI revision: 02
target0:0:15: Beginning Domain Validation
target0:0:15: Ending Domain Validation
sym1: <1010-66> rev 0x1 at pci 0000:41:01.1 irq 104
sym1: No NVRAM, ID 7, Fast-80, LVD, parity checking
sym1: SCSI BUS has been reset.
scsi1 : sym-2.1.18n

#1 lore raw
Quoted 2 lines · Olaf Hering

I think its not a functional problem,
but parts of the disk detection is printed twice.

Yes ...

Quoted 7 lines

...
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
SCSI device sdc: 71096640 512-byte hdwr sectors (36401 MB) SCSI device sdc: drive cache: write through
...

I looked into it some, there was a change from Al to always set bd_invalidated in register_disk(), and then to call blkdev_get. This means the block_dev.c do_open will call rescan_partitions, and in turn call revalidate_disk even for non-removable media.

This change:

http://linux.bkbits.net:8080/linux-2.5/diffs/fs/partitions/[email protected]?nav=index.html|src/|src/fs|src/fs/partitions|hist/fs/partitions/check.c

The log comment from Al says "Work around devices with bogus media change indication on the first open".

Al - What did that fix? Why was that done in the generic block code, and not the affected driver (multiple revalidate_disk call in the driver on device discovery)?

I tested this patch with scsi fixed and removable disks with no problems, but it could break whatever Al fixed. Otherwise it should work with any block driver that calls (for removable/modifiable media) check_disk_change on open and that has a revalidate_disk function and the device is not broken (it looks like that is the correct use of the two functions, I'm not certain).

fs/partitions/check.c +0 -2
diff -uprN -X /home/patman/dontdiff linux-2.6.11-rc1/fs/partitions/check.c no-double-sd-linux-2.6.11-rc1/fs/partitions/check.c
@@ -375,8 +375,6 @@ int rescan_partitions(struct gendisk *di
 	bdev->bd_invalidated = 0;
 	for (p = 1; p < disk->minors; p++)
 		delete_partition(disk, p);
-	if (disk->fops->revalidate_disk)
-		disk->fops->revalidate_disk(disk);
 	if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
 		return 0;
 	for (p = 1; p < state->limit; p++) {

-- Patrick Mansfield