Subject: Bug in bad sector handling in xp.c (#278) Index: pdpuba/xp.c 2.11BSD Description: Enabling the bad sector handling in the SMD (xp.c) driver would cause the system to hang on first access to a drive. Repeat-By: Set BADSECT to YES in the kernel config file, config a kernel and attempt to boot it. The disk activity light will come on but nothing will happen. Fix: When disklabels were added the closing brace ('}') around the section of code which reads the badblock list was left a few lines too high. On the first access to a drive the kernel inserts into the drive queue a request to read the badblock list from the end of the pack. This is only supposed to happen once after a drive comes online, not before each read/write request! The driver ended up continually reading the badblock list. Cut where indicated, saving to a file (/tmp/278). Then: patch -p0 < /tmp/278 If you are using SMD drives you may wish to recompile the kernel but it is not necessary. The change will take effect if/when ever you enable the BADSECT option. ==================cut here================= *** /sys/pdpuba/xp.c.old Tue Aug 22 20:04:54 1995 --- /sys/pdpuba/xp.c Mon Nov 20 09:20:46 1995 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)xp.c 2.2 (2.11BSD GTE) 1995/08/21 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)xp.c 2.3 (2.11BSD GTE) 1995/11/20 */ /* *************** *** 497,503 **** #ifdef XPDEBUG log(LOG_NOTICE, "xp%d preset done\n", unit); #endif ! } /* * XXX - The 'h' partition is used below to access the bad block area. This * XXX - will almost certainly be wrong if the user has defined another --- 497,503 ---- #ifdef XPDEBUG log(LOG_NOTICE, "xp%d preset done\n", unit); #endif ! /* * XXX - The 'h' partition is used below to access the bad block area. This * XXX - will almost certainly be wrong if the user has defined another *************** *** 518,523 **** --- 518,524 ---- bbp->av_forw = bp; bp = bbp; #endif BADSECT + } #if NXPD > 1 /* *** /VERSION.old Mon Oct 30 21:51:20 1995 --- /VERSION Tue Nov 21 13:14:53 1995 *************** *** 1,4 **** ! Current Patch Level: 277 2.11 BSD ============ --- 1,4 ---- ! Current Patch Level: 278 2.11 BSD ============