[9055] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: Problem with MO in 2.2.16

daemon@ATHENA.MIT.EDU (M G Berberich)
Thu Jun 22 05:44:34 2000

Date:	Thu, 22 Jun 2000 11:40:20 +0200
From: M G Berberich <berberic@forwiss.uni-passau.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-scsi@vger.rutgers.edu
Message-ID: <20000622114019.A15553@finarfin.forwiss.uni-passau.de>
Mail-Followup-To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-scsi@vger.rutgers.edu
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-md5;
	protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X"
In-Reply-To: <E134mYr-0001Ko-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Wed, Jun 21, 2000 at 04:37:03PM +0100


--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,

The code that causes the "reset" of the sector-size is in
'drivers/block/genhd.c'

 /*
  * The Linux code now honours the rules the MO people set and
  * is 'DOS compatible' - sizes are scaled by the media block
  * size not 512 bytes. The following is a backwards
  * compatibility check. If a 1k or greater sectorsize disk
  * (1024, 2048, etc) was created under a pre 2.2 kernel,
  * the partition table wrongly used units of 512 instead of
  * units of sectorsize (1024, 2048, etc.) The below check attempts
  * to detect a partition table created under the older kernel, and
  * if so detected, it will reset the a sector scale factor to 1 (i.e.
  * no scaling).
  */
 disk_number_of_sects =3D NR_SECTS((&hd->part[MINOR(dev)]));
 for (i =3D 0; i < 4; i++) {
   char buf[MAX_DISKNAME_LEN];
   struct partition *q =3D &p[i];
   printk(" %s: -bmg- first_sector=3D        %d\n",=20
         disk_name(hd, MINOR(dev), buf), first_sector);
   printk(" %s: -bmg- start_sector=3D        %d\n",=20
         disk_name(hd, MINOR(dev), buf), START_SECT(q));
   printk(" %s: -bmg- nr_sector=3D           %d\n",=20
         disk_name(hd, MINOR(dev), buf), NR_SECTS(q));
   printk(" %s: -bmg- sector_size=3D         %d\n",=20
         disk_name(hd, MINOR(dev), buf), sector_size);
   printk(" %s: -bmg- disk_number_of_sects=3D%d\n",=20
         disk_name(hd, MINOR(dev), buf), disk_number_of_sects);
   if (NR_SECTS(q)) {
     if (((first_sector+(START_SECT(q)+NR_SECTS(q))*sector_size) >
                (disk_number_of_sects+1)) &&
         ((first_sector+(START_SECT(q)+NR_SECTS(q)) <=3D
                disk_number_of_sects))) {
       printk(" %s: RESETTINGING SECTOR SCALE from %d to 1",
                disk_name(hd, MINOR(dev), buf), sector_size);
       sector_size=3D1;
       break;
     }
   }
 }

(the printk's with '-bmg-' are from me) It gives this output if I try
to mount a MO:

 sda: -bmg- first_sector=3D        0
 sda: -bmg- start_sector=3D        1
 sda: -bmg- nr_sector=3D           1241087
 sda: -bmg- sector_size=3D         4
 sda: -bmg- disk_number_of_sects=3D1241408
 sda: RESETTINGING SECTOR SCALE from 4 to 1 sda1

'nr_sector' and 'disk_number_of_sects' seems to be in 512 bytes
blocks, while the MO is 2048 bytes hardsectored, which corresponds
with the 'sector_size' of 4.


	MfG
	bmg

--=20
"Des is v=F6llig wurscht, was heut beschlos- | M G Berberich
 sen wird: I bin sowieso dagegn!"          | berberic@fmi.uni-passau.de
(SPD-Stadtrat Kurt Schindler; Regensburg)  | www.fmi.uni-passau.de/~berberic

--LZvS9be/3tNcYl/X
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia

iQCVAwUBOVHfAj6RkTJp8MntAQHtmgP/WIVyx2/HJhFGsiNUKjM8ngfH8DHQTUgk
KeuRpbnrcgVFweB68T10qYelIitukuWq7AS3Ood+Bk6c1iq6fB/r5zD9NgzfPSiv
ZMV77iMagIckR8zlQZqqUPoEKk9QG8jq330dsxloA/socvZ0fWgZvVsX6kUUq68O
AUVdeDR43mg=
=sWFF
-----END PGP SIGNATURE-----

--LZvS9be/3tNcYl/X--

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post