[net.bugs.4bsd] small bug in stand/hp.c

jeff@ssc-vax.UUCP (05/02/84)

Subject: small bug in hp.c

Index:	/sys/stand/hp.c	4.2BSD

Description:
	Placement of 'st' (drive table ptr) initialization causes 
	no such after 1st open call (when hp_type[unit] is non-0.)  
	Thus, stand-alone programs which reopen a disk multiple times 
	fail after the first open because a garbage io->i_boff is recalculated 
	using a nonsense st->off address in turn causing totally wild
	disk addresses to be calculated in the strategy routine.  (This is, 
	for instance, why the program described in format(8V) doesn't work 
	without a reload from the floppy if you try to format a second pack
	using only one invocation of the program.)
Repeat-By:
	See above.
Fix:

*** hp.c	Tue May  1 17:39:57 1984
--- ,hp.c	Sun Sep 25 18:06:33 1983
***************
*** 117,124
  				hpbad[unit].bt_bad[i].bt_trksec = -1;
  			}
  		}	
! 	} else	
! 		st = &hpst[hp_type[unit]];
  	if (io->i_boff < 0 || io->i_boff > 7 ||
  	    st->off[io->i_boff]== -1)
  		_stop("hp bad minor");

--- 117,123 -----
  				hpbad[unit].bt_bad[i].bt_trksec = -1;
  			}
  		}	
! 	}
  	if (io->i_boff < 0 || io->i_boff > 7 ||
  	    st->off[io->i_boff]== -1)
  		_stop("hp bad minor");

------------------------------------------------------------------
				 - jeffrey jongeward
				   boeing aerospace co., seattle
				   uw-beaver!ssc-vax!jeff