Subject: kern/16789: wddump() cannot dump to an unopened device
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mkiiskila@yahoo.com>
List: netbsd-bugs
Date: 05/13/2002 09:57:08
>Number:         16789
>Category:       kern
>Synopsis:       wddump() cannot dump to an unopened device
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 13 09:58:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     M Kiiskila
>Release:        1.5
>Organization:
>Environment:
NetBSD pelikone 1.5 NetBSD 1.5 (GENERIC) #1: Sun Nov 19 21:42:11 MET 2000     fvdl@sushi:/work/trees/netbsd-1-5/sys/arch/i386/compile/GENERIC i386

>Description:
Trying to dump to a partition which is not being used as swap
doesn't work.
>How-To-Repeat:

>Fix:
The following fixes this for me:

1293c1293
<       int err;
---
>       int err, omask;
1310,1311c1310,1317
<       /* Make sure it was initialized. */
<       if (wd->drvp->state < READY)
---
>       omask = wd->sc_dk.dk_openmask & (1 << part);
> 
>       /*
>          * Make sure it was initialized.
>          * If closed, try to open
>          */
>       if ((wd->drvp->state < READY) &&
>           (omask == 0 && wdopen(dev, 0, S_IFBLK, NULL) != 0)) {
1312a1319
>       }

>Release-Note:
>Audit-Trail:
>Unformatted: