FIRST SECTOR IN MULTISECTOR READ IN BAD144 TABLE
authorFrank Maclachlan <fpm@crash.cts.com>
Wed, 19 Aug 1992 00:00:00 +0000 (00:00 +0000)
committerFrank Maclachlan <fpm@crash.cts.com>
Wed, 19 Aug 1992 00:00:00 +0000 (00:00 +0000)
The bad144 table search code at finds the sector in the bad144
table and replaces the block number, cylinder, head, and sector addresses
with values corresponding to the replacement sector.  The sector count
register is loaded with the number of sectors in the entire transfer.
This is wrong; it *MUST* be set to *one* sector.  A read would return
the wrong data in sectors after the first; a write would *overwrite*
other replacement sectors or even the bad144 table on the last track.

AUTHOR: Frank Maclachlan (fpm@crash.cts.com)
386BSD-Patchkit: patch00004

usr/src/sys.386bsd/i386/isa/wd.c

index e9b1a10..a72bb53 100644 (file)
  * SUCH DAMAGE.
  *
  *     from:@(#)wd.c   7.2 (Berkeley) 5/9/91
  * SUCH DAMAGE.
  *
  *     from:@(#)wd.c   7.2 (Berkeley) 5/9/91
+ *
+ * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
+ * --------------------         -----   ----------------------
+ * CURRENT PATCH LEVEL:         1       00004
+ * --------------------         -----   ----------------------
+ *
+ * 19 Aug 92    Frank Maclachlan       Fixed bug when first sector of a
+ *                                     multisector read is in bad144 table.
  */
 
 /* TODO:peel out buffer at low ipl, speed improvement */
  */
 
 /* TODO:peel out buffer at low ipl, speed improvement */
@@ -379,8 +387,8 @@ loop:
         * See if the current block is in the bad block list.
         * (If we have one, and not formatting.)
         */
         * See if the current block is in the bad block list.
         * (If we have one, and not formatting.)
         */
-       if ((du->dk_flags & (/*DKFL_SINGLE|*/DKFL_BADSECT))
-               == (/*DKFL_SINGLE|*/DKFL_BADSECT))
+       if ((du->dk_flags & (DKFL_SINGLE|DKFL_BADSECT))         /* 19 Aug 92*/
+               == (DKFL_SINGLE|DKFL_BADSECT))
            for (bt_ptr = du->dk_bad.bt_bad; bt_ptr->bt_cyl != -1; bt_ptr++) {
                if (bt_ptr->bt_cyl > cylin)
                        /* Sorted list, and we passed our cylinder. quit. */
            for (bt_ptr = du->dk_bad.bt_bad; bt_ptr->bt_cyl != -1; bt_ptr++) {
                if (bt_ptr->bt_cyl > cylin)
                        /* Sorted list, and we passed our cylinder. quit. */