Brought over two fixes from 1.1.5; this now makes this driver "up to date"

with 1.1.5:

  revision 1.40
  date: 1994/06/17 16:57:03;  author: pst;  state: Exp;  lines: +4 -2
  From: Gill Kloepfer Jr. <gil@limbic.ssdl.com>
  Verified by: pst

  > The DIOCSBAD ioctl sets a bad block table (is almost suredly called by
  > the bad144 utility) and changes the memory-resident bad block table.  The
  > problem is that bad144intern() is not called after the "disk" structure has
  > been changed, so that the internal bad144 table will become out-of-sync with
  > the one in the disk structure.
  ----------------------------
  revision 1.39
  date: 1994/06/07 01:36:39;  author: phk;  state: Exp;  lines: +3 -2
  another place option !defined(DISKLABEL_UNPROTECTED) was needed.
This commit is contained in:
David Greenman 1994-09-10 03:19:49 +00:00
parent 4d6c4fc70c
commit c1bb2f57d0

View File

@ -37,7 +37,7 @@ static int wdtest = 0;
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
* $Id: wd.c,v 1.44 1994/08/29 21:35:16 ache Exp $
* $Id: wd.c,v 1.45 1994/08/30 14:26:13 ache Exp $
*/
/* TODO:
@ -362,13 +362,14 @@ wdstrategy(register struct buf *bp)
goto done;
}
#if !defined(DISKLABEL_UNPROTECTED)
/* "soft" write protect check */
if ((du->dk_flags & DKFL_WRITEPROT) && (bp->b_flags & B_READ) == 0) {
bp->b_error = EROFS;
bp->b_flags |= B_ERROR;
goto done;
}
#endif /* !defined(DISKLABEL_UNPROTECTED) */
/*
* Do bounds checking, adjust transfer, and set b_cylin.
*/
@ -1282,8 +1283,10 @@ wdioctl(dev_t dev, int cmd, caddr_t addr, int flag)
case DIOCSBAD:
if ((flag & FWRITE) == 0)
error = EBADF;
else
else {
du->dk_bad = *(struct dkbad *)addr;
bad144intern(du);
}
break;
case DIOCGDINFO: