Browse Source

Plan 9 from Bell Labs 2011-03-29

David du Colombier 13 years ago
parent
commit
5a76bfbdba

+ 11 - 11
adm/timezone/Canada_Atlantic

@@ -11,14 +11,14 @@ AST -14400 ADT -10800
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Central

@@ -11,14 +11,14 @@ CST -21600 CDT -18000
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 23 - 0
adm/timezone/Canada_East-Saskatchewan

@@ -1 +1,24 @@
 CST -21600 CST -21600
+   9943200   25664400   41392800   57718800   73447200   89168400
+ 104896800  120618000  136346400  152067600  167796000  183517200
+ 199245600  215571600  230695200  247021200  262749600  278470800
+ 294199200  309920400  325648800  341370000  357098400  372819600
+ 388548000  404874000  419997600  436323600  452052000  467773200
+ 483501600  499222800  514951200  530672400  544586400  562122000
+ 576036000  594176400  607485600  625626000  638935200  657075600
+ 670989600  688525200  702439200  719974800  733888800  752029200
+ 765338400  783478800  796788000  814928400  828842400  846378000
+ 860292000  877827600  891741600  909277200  923191200  941331600
+ 954640800  972781200  986090400 1004230800 1018144800 1035680400
+1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Eastern

@@ -11,14 +11,14 @@ EST -18000 EDT -14400
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Mountain

@@ -11,14 +11,14 @@ MST -25200 MDT -21600
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Newfoundland

@@ -11,14 +11,14 @@ NST -12600 NDT -9000
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Pacific

@@ -11,14 +11,14 @@ PST -28800 PDT -25200
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 11 - 11
adm/timezone/Canada_Yukon

@@ -11,14 +11,14 @@ YST -32400 YDT -28800
  860292000  877827600  891741600  909277200  923191200  941331600
  954640800  972781200  986090400 1004230800 1018144800 1035680400
 1049594400 1067130000 1081044000 1099184400 1112493600 1130634000
-1143943200 1162083600 1175392800 1193533200 1207447200 1224982800
-1238896800 1256432400 1270346400 1288486800 1301796000 1319936400
-1333245600 1351386000 1365300000 1382835600 1396749600 1414285200
-1428199200 1445734800 1459648800 1477789200 1491098400 1509238800
-1522548000 1540688400 1554602400 1572138000 1586052000 1603587600
-1617501600 1635642000 1648951200 1667091600 1680400800 1698541200
-1712455200 1729990800 1743904800 1761440400 1775354400 1792890000
-1806804000 1824944400 1838253600 1856394000 1869703200 1887843600
-1901757600 1919293200 1933207200 1950742800 1964656800 1982797200
-1996106400 2014246800 2027556000 2045696400 2059005600 2077146000
-2091060000 2108595600 2122509600 2140045200
+1143943200 1162083600 1173578400 1194138000 1205028000 1225587600
+1236477600 1257037200 1268532000 1289091600 1299981600 1320541200
+1331431200 1351990800 1362880800 1383440400 1394330400 1414890000
+1425780000 1446339600 1457834400 1478394000 1489284000 1509843600
+1520733600 1541293200 1552183200 1572742800 1583632800 1604192400
+1615687200 1636246800 1647136800 1667696400 1678586400 1699146000
+1710036000 1730595600 1741485600 1762045200 1772935200 1793494800
+1804989600 1825549200 1836439200 1856998800 1867888800 1888448400
+1899338400 1919898000 1930788000 1951347600 1962842400 1983402000
+1994292000 2014851600 2025741600 2046301200 2057191200 2077750800
+2088640800 2109200400 2120090400 2140650000 

+ 32 - 0
sys/src/cmd/scuzz/scsireq.c

@@ -154,6 +154,13 @@ SRread(ScsiReq *rp, void *buf, long nbytes)
 	long n;
 
 	if((nbytes % rp->lbsize) || nbytes > maxiosize){
+		if(debug)
+			if (nbytes % rp->lbsize)
+				fprint(2, "scuzz: i/o size %ld %% %ld != 0\n",
+					nbytes, rp->lbsize);
+			else
+				fprint(2, "scuzz: i/o size %ld > %ld\n",
+					nbytes, maxiosize);
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -215,6 +222,13 @@ SRwrite(ScsiReq *rp, void *buf, long nbytes)
 	long n;
 
 	if((nbytes % rp->lbsize) || nbytes > maxiosize){
+		if(debug)
+			if (nbytes % rp->lbsize)
+				fprint(2, "scuzz: i/o size %ld %% %ld != 0\n",
+					nbytes, rp->lbsize);
+			else
+				fprint(2, "scuzz: i/o size %ld > %ld\n",
+					nbytes, maxiosize);
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -268,6 +282,8 @@ SRseek(ScsiReq *rp, long offset, int type)
 		/*FALLTHROUGH*/
 
 	default:
+		if(debug)
+			fprint(2, "scuzz: seek failed\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -545,6 +561,8 @@ int
 SRclose(ScsiReq *rp)
 {
 	if((rp->flags & Fopen) == 0){
+		if(debug)
+			fprint(2, "scuzz: closing closed file\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -576,8 +594,14 @@ dirdevopen(ScsiReq *rp)
 		 */
 		return rp->inquiry[1] & 0x80 && (mkascq(rp) >> 8) == 0x023a?
 			0: -1;
+	memset(data, 0, sizeof data);
+	if(SRrcapacity(rp, data) == -1)
+		return -1;
 	rp->lbsize = GETBELONG(data+4);
 	blocks =     GETBELONG(data);
+	if(debug)
+		fprint(2, "scuzz: dirdevopen: logical block size %lud, "
+			"# blocks %lud\n", rp->lbsize, blocks);
 	/* some newer dev's don't support 6-byte commands */
 	if(blocks > Max24off && !force6bytecmds)
 		rp->flags |= Frw10;
@@ -594,6 +618,9 @@ seqdevopen(ScsiReq *rp)
 	if(limits[1] == 0 && limits[2] == limits[4] && limits[3] == limits[5]){
 		rp->flags |= Fbfixed;
 		rp->lbsize = limits[4]<<8 | limits[5];
+		if(debug)
+			fprint(2, "scuzz: seqdevopen: logical block size %lud\n",
+				rp->lbsize);
 		return 0;
 	}
 	/*
@@ -651,6 +678,9 @@ wormdevopen(ScsiReq *rp)
 	else
 		/* last 3 bytes of block 0 descriptor */
 		rp->lbsize = GETBE24(list+13);
+	if(debug)
+		fprint(2, "scuzz: wormdevopen: logical block size %lud\n",
+			rp->lbsize);
 	return status;
 }
 
@@ -660,6 +690,8 @@ SRopenraw(ScsiReq *rp, char *unit)
 	char name[128];
 
 	if(rp->flags & Fopen){
+		if(debug)
+			fprint(2, "scuzz: opening open file\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}

+ 1 - 1
sys/src/cmd/scuzz/scuzz.c

@@ -178,7 +178,7 @@ cmdread(ScsiReq *rp, int argc, char *argv[])
 		}
 		break;
 	}
-	print("bsize=%lud\n", rp->lbsize);
+	print("device native block size=%lud\n", rp->lbsize);
 	total = 0;
 	while(nbytes){
 		n = vlmin(nbytes, iosize);

+ 7 - 2
sys/src/cmd/usb/disk/disk.c

@@ -45,7 +45,7 @@ static Dirtab dirtab[] =
 int exabyte, force6bytecmds;
 long maxiosize = MaxIOsize;
 
-static int diskdebug;
+int diskdebug;
 
 static int
 getmaxlun(Dev *dev)
@@ -109,6 +109,7 @@ umscapacity(Umsc *lun)
 	lun->blocks = 0;
 	lun->capacity = 0;
 	lun->lbsize = 0;
+	memset(data, 0, sizeof data);
 	if(SRrcapacity(lun, data) < 0 && SRrcapacity(lun, data)  < 0)
 		return -1;
 	lun->blocks = GETBELONG(data);
@@ -120,11 +121,15 @@ umscapacity(Umsc *lun)
 			return -1;
 		}else{
 			lun->lbsize = GETBELONG(data + 8);
-			lun->blocks = (uvlong)GETBELONG(data)<<32 | GETBELONG(data + 4);
+			lun->blocks = (uvlong)GETBELONG(data)<<32 |
+				GETBELONG(data + 4);
 		}
 	}
 	lun->blocks++; /* SRcapacity returns LBA of last block */
 	lun->capacity = (vlong)lun->blocks * lun->lbsize;
+	if(diskdebug)
+		fprint(2, "disk: logical block size %lud, # blocks %llud\n",
+			lun->lbsize, lun->blocks);
 	return 0;
 }
 

+ 42 - 9
sys/src/cmd/usb/disk/scsireq.c

@@ -6,17 +6,15 @@
  *	we set req.lun/unit to rp->lun/unit in SRreqsense
  *	we set the rp->sense[0] bit Sd0valid in SRreqsense
  * This does not use libdisk to retrieve the scsi error to make
- * user we see the diagnostics if we boot with debug enabled.
- * 
- */
-
-#include <u.h>
-#include <libc.h>
-/*
+ * user see the diagnostics if we boot with debug enabled.
+ *
  * BUGS:
  *	no luns
  *	and incomplete in many other ways
  */
+
+#include <u.h>
+#include <libc.h>
 #include "scsireq.h"
 
 enum {
@@ -202,6 +200,8 @@ seqdevrw(ScsiReq *rp, uchar *cmd, long nbytes)
 	return 6;
 }
 
+extern int diskdebug;
+
 long
 SRread(ScsiReq *rp, void *buf, long nbytes)
 {
@@ -209,6 +209,13 @@ SRread(ScsiReq *rp, void *buf, long nbytes)
 	long n;
 
 	if((nbytes % rp->lbsize) || nbytes > maxiosize){
+		if(diskdebug)
+			if (nbytes % rp->lbsize)
+				fprint(2, "disk: i/o size %ld %% %ld != 0\n",
+					nbytes, rp->lbsize);
+			else
+				fprint(2, "disk: i/o size %ld > %ld\n",
+					nbytes, maxiosize);
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -266,6 +273,13 @@ SRwrite(ScsiReq *rp, void *buf, long nbytes)
 	long n;
 
 	if((nbytes % rp->lbsize) || nbytes > maxiosize){
+		if(diskdebug)
+			if (nbytes % rp->lbsize)
+				fprint(2, "disk: i/o size %ld %% %ld != 0\n",
+					nbytes, rp->lbsize);
+			else
+				fprint(2, "disk: i/o size %ld > %ld\n",
+					nbytes, maxiosize);
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -319,6 +333,8 @@ SRseek(ScsiReq *rp, long offset, int type)
 		/*FALLTHROUGH*/
 
 	default:
+		if(diskdebug)
+			fprint(2, "disk: seek failed\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -780,6 +796,8 @@ int
 SRclose(ScsiReq *rp)
 {
 	if((rp->flags & Fopen) == 0){
+		if(diskdebug)
+			fprint(2, "disk: closing closed file\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}
@@ -791,18 +809,25 @@ SRclose(ScsiReq *rp)
 static int
 dirdevopen(ScsiReq *rp)
 {
-	ulong blocks;
-	uchar data[8];
+	uvlong blocks;
+	uchar data[8+4+20];	/* 16-byte result: lba, blksize, reserved */
 
+	memset(data, 0, sizeof data);
 	if(SRstart(rp, 1) == -1 || SRrcapacity(rp, data) == -1)
 		return -1;
 	rp->lbsize = GETBELONG(data+4);
 	blocks =     GETBELONG(data);
+	if(debug)
+		fprint(2, "disk: dirdevopen: 10-byte logical block size %lud, "
+			"# blocks %llud\n", rp->lbsize, blocks);
 	if(blocks == 0xffffffff){
 		if(SRrcapacity16(rp, data) == -1)
 			return -1;
 		rp->lbsize = GETBELONG(data + 8);
 		blocks = (vlong)GETBELONG(data)<<32 | GETBELONG(data + 4);
+		if(debug)
+			fprint(2, "disk: dirdevopen: 16-byte logical block size"
+				" %lud, # blocks %llud\n", rp->lbsize, blocks);
 	}
 	/* some newer dev's don't support 6-byte commands */
 	if(blocks > Max24off && !force6bytecmds)
@@ -820,6 +845,9 @@ seqdevopen(ScsiReq *rp)
 	if(limits[1] == 0 && limits[2] == limits[4] && limits[3] == limits[5]){
 		rp->flags |= Fbfixed;
 		rp->lbsize = limits[4]<<8 | limits[5];
+		if(debug)
+			fprint(2, "disk: seqdevopen: 10-byte logical block size %lud\n",
+				rp->lbsize);
 		return 0;
 	}
 	/*
@@ -877,6 +905,9 @@ wormdevopen(ScsiReq *rp)
 	else
 		/* last 3 bytes of block 0 descriptor */
 		rp->lbsize = GETBE24(list+13);
+	if(debug)
+		fprint(2, "disk: wormdevopen: 10-byte logical block size %lud\n",
+			rp->lbsize);
 	return status;
 }
 
@@ -886,6 +917,8 @@ SRopenraw(ScsiReq *rp, char *unit)
 	char name[128];
 
 	if(rp->flags & Fopen){
+		if(diskdebug)
+			fprint(2, "disk: opening open file\n");
 		rp->status = Status_BADARG;
 		return -1;
 	}

+ 3 - 2
sys/src/cmd/usb/disk/scsireq.h

@@ -1,9 +1,10 @@
 /*
- * This is /sys/src/cmd/scuzz/scsireq.c
+ * This is /sys/src/cmd/scuzz/scsireq.h
  * changed to add more debug support, to keep
  * disk compiling without a scuzz that includes these changes.
+ *
+ * this file is also included by usb/disk and cdfs
  */
-/* this file is also included by usb/disk and cdfs */
 typedef struct Umsc Umsc;
 #pragma incomplete Umsc