NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/42122: larger than 2TB drives can't be properly found at boot



The following reply was made to PR kern/42122; it has been noted by GNATS.

From: Tracy Di Marco White <gendalia%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/42122: larger than 2TB drives can't be properly found at 
        boot
Date: Mon, 15 Feb 2010 14:13:22 -0600

 With this patch:
 
 # dmesg|grep ^sd
 sd0 at scsibus0 target 0 lun 0: <, , R0.0> disk fixed
 sd0: 512, 238020 cyl, 128 head, 0 sec, 512 bytes/sect x 1 sectors
 sd0: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 sd1 at scsibus0 target 1 lun 0: <, , R0.0> disk fixed
 sd1: 512, 178682 cyl, 128 head, 0 sec, 512 bytes/sect x 1 sectors
 sd1: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 sd2 at scsibus1 target 0 lun 0: <IFT, A16U-G2430, 348C> disk fixed
 sd2: 512, 112619 cyl, 255 head, 0 sec, 512 bytes/sect x 1 sectors
 sd2: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 
 And things don't work, none of the scsi disks' file systems are found.
 
 Without this patch:
 bash-3.00# dmesg|grep ^sd
 sd0 at scsibus0 target 0 lun 0: <, , R0.0> disk fixed
 sd0: 1859 GB, 238020 cyl, 128 head, 128 sec, 512 bytes/sect x 3899719680 se=
 ctors
 sd0: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 sd1 at scsibus0 target 1 lun 0: <, , R0.0> disk fixed
 sd1: 1395 GB, 178682 cyl, 128 head, 128 sec, 512 bytes/sect x 2927525888 se=
 ctors
 sd1: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 sd2 at scsibus1 target 0 lun 0: <IFT, A16U-G2430, 348C> disk fixed
 sd2: 512, 112619 cyl, 255 head, 0 sec, 512 bytes/sect x 1 sectors
 sd2: sync (6.25ns offset 127), 16-bit (320.000MB/s) transfers, tagged queue=
 ing
 
 On Wed, Jan 27, 2010 at 11:20 PM, David Holland
 <dholland-bugs%netbsd.org@localhost> wrote:
 > The following reply was made to PR kern/42122; it has been noted by GNATS=
 .
 >
 > From: David Holland <dholland-bugs%netbsd.org@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:
 > Subject: Re: kern/42122: larger than 2TB drives can't be properly found a=
 t
 > =A0 =A0 =A0 =A0boot
 > Date: Thu, 28 Jan 2010 05:18:08 +0000
 >
 > =A0(wasn't sent to gnats-bugs)
 >
 > =A0 =A0------
 >
 > =A0From: Michael van Elst <mlelstv%serpens.de@localhost>
 > =A0To: gnats%netbsd.org@localhost
 > =A0Subject: Re: kern/42122: larger than 2TB drives can't be properly foun=
 d at
 > =A0 =A0 =A0 =A0boot
 > =A0Date: Mon, 25 Jan 2010 13:54:06 +0100
 >
 >
 > =A0The Array should return -1 with read_capacity_10 to signal
 > =A0that read_capacity_16 is required. Apparently this is not
 > =A0implemented right. A workaround is to try the read_capacity_16
 > =A0first and retry with read_capacity_10 if the command wasn't
 > =A0accepted (Invalid Command).
 >
 > =A0Does this patch help?
 >
 > =A0Index: sd.c
 > =A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > =A0RCS file: /cvsroot/src/sys/dev/scsipi/sd.c,v
 > =A0retrieving revision 1.290
 > =A0diff -u -r1.290 sd.c
 > =A0--- sd.c =A0 =A0 =A0 21 Oct 2009 21:12:05 -0000 =A0 =A0 =A01.290
 > =A0+++ sd.c =A0 =A0 =A0 25 Jan 2010 11:26:14 -0000
 > =A0@@ -1679,9 +1679,7 @@
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct scsipi_read_capacity_16_data data16=
 ;
 > =A0 =A0 =A0 =A0} *datap;
 > =A0 =A0 =A0 =A0uint64_t rv;
 > =A0-
 > =A0- =A0 =A0 =A0memset(&cmd, 0, sizeof(cmd));
 > =A0- =A0 =A0 =A0cmd.cmd.opcode =3D READ_CAPACITY_10;
 > =A0+ =A0 =A0 =A0int error;
 >
 > =A0 =A0 =A0 =A0/*
 > =A0 =A0 =A0 =A0 * Don't allocate data buffer on stack;
 > =A0@@ -1693,43 +1691,44 @@
 > =A0 =A0 =A0 =A0if (datap =3D=3D NULL)
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0;
 >
 > =A0- =A0 =A0 =A0/*
 > =A0- =A0 =A0 =A0 * If the command works, interpret the result as a 4 byte
 > =A0- =A0 =A0 =A0 * number of blocks
 > =A0- =A0 =A0 =A0 */
 > =A0 =A0 =A0 =A0rv =3D 0;
 > =A0- =A0 =A0 =A0memset(datap, 0, sizeof(datap->data));
 > =A0- =A0 =A0 =A0if (scsipi_command(periph, (void *)&cmd.cmd, sizeof(cmd.c=
 md),
 > =A0- =A0 =A0 =A0 =A0 =A0(void *)datap, sizeof(datap->data), SCSIPIRETRIES=
 , 20000, NULL,
 > =A0- =A0 =A0 =A0 =A0 =A0flags | XS_CTL_DATA_IN | XS_CTL_SILENT) !=3D 0)
 > =A0- =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;
 > =A0-
 > =A0- =A0 =A0 =A0if (_4btol(datap->data.addr) !=3D 0xffffffff) {
 > =A0- =A0 =A0 =A0 =A0 =A0 =A0 =A0*blksize =3D _4btol(datap->data.length);
 > =A0- =A0 =A0 =A0 =A0 =A0 =A0 =A0rv =3D _4btol(datap->data.addr) + 1;
 > =A0- =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;
 > =A0- =A0 =A0 =A0}
 >
 > =A0 =A0 =A0 =A0/*
 > =A0- =A0 =A0 =A0 * Device is larger than can be reflected by READ CAPACIT=
 Y (10).
 > =A0- =A0 =A0 =A0 * Try READ CAPACITY (16).
 > =A0+ =A0 =A0 =A0 * Try READ CAPACITY (16) first, some disks don't return
 > =A0+ =A0 =A0 =A0 * a correct overflow with READ CAPACITY (10).
 > =A0 =A0 =A0 =A0 */
 > =A0-
 > =A0 =A0 =A0 =A0memset(&cmd, 0, sizeof(cmd));
 > =A0 =A0 =A0 =A0cmd.cmd16.opcode =3D READ_CAPACITY_16;
 > =A0 =A0 =A0 =A0cmd.cmd16.byte2 =3D SRC16_SERVICE_ACTION;
 > =A0 =A0 =A0 =A0_lto4b(sizeof(datap->data16), cmd.cmd16.len);
 >
 > =A0 =A0 =A0 =A0memset(datap, 0, sizeof(datap->data16));
 > =A0- =A0 =A0 =A0if (scsipi_command(periph, (void *)&cmd.cmd16, sizeof(cmd=
 .cmd16),
 > =A0+ =A0 =A0 =A0error =3D scsipi_command(periph, (void *)&cmd.cmd16, size=
 of(cmd.cmd16),
 > =A0 =A0 =A0 =A0 =A0 =A0(void *)datap, sizeof(datap->data16), SCSIPIRETRIE=
 S, 20000, NULL,
 > =A0- =A0 =A0 =A0 =A0 =A0flags | XS_CTL_DATA_IN | XS_CTL_SILENT) !=3D 0)
 > =A0- =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out;
 > =A0+ =A0 =A0 =A0 =A0 =A0flags | XS_CTL_DATA_IN | XS_CTL_SILENT);
 >
 > =A0- =A0 =A0 =A0*blksize =3D _4btol(datap->data16.length);
 > =A0- =A0 =A0 =A0rv =3D _8btol(datap->data16.addr) + 1;
 > =A0+ =A0 =A0 =A0if (error =3D=3D 0) {
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0*blksize =3D _4btol(datap->data16.length)=
 ;
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0rv =3D _8btol(datap->data16.addr) + 1;
 > =A0+ =A0 =A0 =A0} else if (error =3D=3D EINVAL) {
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0/*
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Fall back to READ CAPACITY (10)
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0memset(&cmd, 0, sizeof(cmd));
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0cmd.cmd.opcode =3D READ_CAPACITY_10;
 > =A0+
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0memset(datap, 0, sizeof(datap->data));
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D scsipi_command(periph, (void *)=
 &cmd.cmd, sizeof(cmd.cmd),
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(void *)datap, sizeof(datap->data=
 ), SCSIPIRETRIES, 20000, NULL,
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flags | XS_CTL_DATA_IN | XS_CTL_S=
 ILENT);
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0if (error =3D=3D 0) {
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (_4btol(datap->data.ad=
 dr) !=3D 0xffffffff) {
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*blksize =
 =3D _4btol(datap->data.length);
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rv =3D _4=
 btol(datap->data.addr) + 1;
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
 > =A0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0}
 > =A0+ =A0 =A0 =A0}
 >
 > =A0- out:
 > =A0 =A0 =A0 =A0free(datap, M_TEMP);
 > =A0 =A0 =A0 =A0return rv;
 > =A0}
 >
 > =A0--
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Michael v=
 an Elst
 > =A0Internet: mlelstv%serpens.de@localhost
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "A potent=
 ial Snark may lurk in every tree."
 >
 >
 


Home | Main Index | Thread Index | Old Index