From c1bb2f57d094d883958b97e52699b9c997000f56 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Sat, 10 Sep 1994 03:19:49 +0000 Subject: [PATCH] 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. 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. --- sys/i386/isa/wd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index 3aa76e01ba28..4569cc5d2b32 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -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: