A bug has been found in lhd.c - it seems that the lhd raw device does
not handle I/Os that are more than one sector long correctly. Thanks
to Jeff DeSoto for catching this.
Patch follows.
Index: src/kern/dev/lamebus/lhd.c
===================================================================
RCS file: /disk/disk0/cs161/CVSREPO/os161/src/kern/dev/lamebus/lhd.c,v
retrieving revision 1.4
diff -u -r1.4 lhd.c
--- lhd.c 2001/02/02 10:16:36 1.4
+++ lhd.c 2001/03/23 20:12:42
@@ -186,7 +186,7 @@
}
/* Don't allow I/O past the end of the disk. */
- if (sector >= lh->lh_dev.d_blocks) {
+ if (sector+len >= lh->lh_dev.d_blocks) {
return EINVAL;
}
@@ -213,7 +213,7 @@
}
/* Tell it what sector we want... */
- lhd_wreg(lh, LHD_REG_SECT, sector);
+ lhd_wreg(lh, LHD_REG_SECT, sector+i);
/* and start the operation. */
lhd_wreg(lh, LHD_REG_STAT, statval);
--
- David A. Holland | VINO project home page:
dholland(a)eecs.harvard.edu |
http://www.eecs.harvard.edu/vino