From: Gill Kloepfer Jr. <gil@limbic.ssdl.com>
authorPaul Traina <pst@anise.acc.com>
Fri, 17 Jun 1994 16:57:03 +0000 (16:57 +0000)
committerPaul Traina <pst@anise.acc.com>
Fri, 17 Jun 1994 16:57:03 +0000 (16:57 +0000)
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.

sys/i386/isa/wd.c

index 2626f61..5d9bf91 100644 (file)
@@ -37,7 +37,7 @@ static int wdtest = 0;
  * SUCH DAMAGE.
  *
  *     from: @(#)wd.c  7.2 (Berkeley) 5/9/91
  * SUCH DAMAGE.
  *
  *     from: @(#)wd.c  7.2 (Berkeley) 5/9/91
- *     $Id: wd.c,v 1.38 1994/04/20 07:06:44 davidg Exp $
+ *     $Id: wd.c,v 1.39 1994/06/07 01:36:39 phk Exp $
  */
 
 /* TODO:
  */
 
 /* TODO:
@@ -1278,8 +1278,10 @@ wdioctl(dev_t dev, int cmd, caddr_t addr, int flag)
        case DIOCSBAD:
                if ((flag & FWRITE) == 0)
                        error = EBADF;
        case DIOCSBAD:
                if ((flag & FWRITE) == 0)
                        error = EBADF;
-               else
+               else {
                        du->dk_bad = *(struct dkbad *)addr;
                        du->dk_bad = *(struct dkbad *)addr;
+                       bad144intern(du);
+               }
                break;
 
        case DIOCGDINFO:
                break;
 
        case DIOCGDINFO: