NetBSD Problem Report #16789

Received: (qmail 21535 invoked from network); 13 May 2002 16:57:08 -0000
Message-Id: <20020513165708.C84BB11137@www.netbsd.org>
Date: Mon, 13 May 2002 09:57:08 -0700 (PDT)
From: mkiiskila@yahoo.com
Sender: nobody@netbsd.org
Reply-To: mkiiskila@yahoo.com
To: gnats-bugs@gnats.netbsd.org
Subject: wddump() cannot dump to an unopened device
X-Send-Pr-Version: www-1.0

>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 16:58:00 +0000 2002
>Closed-Date:    
>Last-Modified:  Wed Oct 24 22:25:00 +0000 2018
>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:

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: mkiiskila@yahoo.com
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16789: wddump() cannot dump to an unopened device
Date: Fri, 27 Sep 2002 20:56:55 +0200

 I believe I've just fixed this in -current:

 RCS file: /cvsroot/syssrc/sys/dev/ata/wd.c,v
 revision 1.226
 date: 2002/09/27 17:17:53;  author: drochner;  state: Exp;  lines: +2 -6
 Remove a check whether the drive is initialized before crashdump.
 It prevents dumping on an otherwise unused disk and seems
 unnecessary anyway - the driver will deal with initialization.
 fixes my PR kern/18135

 Can you give it a try?
 If it helps, pullups to the 1.5 and 1.6 release branches can be
 considered.

 best regards
 Matthias


State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Fri, 27 Nov 2009 21:48:01 +0000
State-Changed-Why:
Believed fixed in 2002


State-Changed-From-To: closed->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 30 Nov 2009 00:16:56 +0000
State-Changed-Why:
jakllsch says it isn't fixed.


From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/16789 CVS commit: [jdolecek-ncq] src/sys/dev/ata
Date: Tue, 20 Jun 2017 21:55:09 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Tue Jun 20 21:55:09 UTC 2017

 Modified Files:
 	src/sys/dev/ata [jdolecek-ncq]: TODO.ncq

 Log Message:
 some more notes for dump on unopened device (PR kern/16789)


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/sys/dev/ata/TODO.ncq

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: kern/16789
Date: Wed, 24 Oct 2018 21:51:52 +0200

 Some observation from the time when I was implementing NCQ:

 dump to unopened disk fails (e.g. dump do wd1b when wd1a not mounted), due
 to the open path executing ata_get_params(), which eventually tsleeps()
 while waiting for the command to finish; specifically, if WDF_LOADED is not
 set
 - happens due to wd_get_params() with just AT_WAIT in wdopen()
 - not easy to fix, open needs to read disklabel and all this mechanics
   is too much for emergency crash dump code path

 It would be nice if some brave soul tackled this. One possible avenue
 would be to take advantage of the disklabel being implicitly read on
 swapon, and use the cached information when system opens the device to
 take the dump.

 Jaromir

From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/16789 CVS commit: src/sys/dev/ata
Date: Wed, 24 Oct 2018 20:03:07 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Wed Oct 24 20:03:07 UTC 2018

 Removed Files:
 	src/sys/dev/ata: TODO.ncq

 Log Message:
 remove TODO.ncq; the FIS note was added to atastart(), and the note
 about dump to unopened wd(4) device was attached to PR kern/16789, and
 nothing else remains


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r0 src/sys/dev/ata/TODO.ncq

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/16789
Date: Wed, 24 Oct 2018 22:31:20 +0200

 On Wed, Oct 24, 2018 at 07:55:01PM +0000, Jaromír Doleček wrote:
 >  dump to unopened disk fails (e.g. dump do wd1b when wd1a not mounted), due
 >  to the open path executing ata_get_params(), which eventually tsleeps()
 >  while waiting for the command to finish; specifically, if WDF_LOADED is not
 >  set
 >  - happens due to wd_get_params() with just AT_WAIT in wdopen()
 >  - not easy to fix, open needs to read disklabel and all this mechanics
 >    is too much for emergency crash dump code path

 Would it be reasonable to open wd1b when it is configured as dump
 device? I assume if it is also a swap device, it works fine?

 Joerg

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org, mkiiskila@yahoo.com
Subject: re: kern/16789
Date: Thu, 25 Oct 2018 09:24:10 +1100

 >  >  dump to unopened disk fails (e.g. dump do wd1b when wd1a not mounted=
 ), due
 >  >  to the open path executing ata_get_params(), which eventually tsleep=
 s()
 >  >  while waiting for the command to finish; specifically, if WDF_LOADED=
  is not
 >  >  set
 >  >  - happens due to wd_get_params() with just AT_WAIT in wdopen()
 >  >  - not easy to fix, open needs to read disklabel and all this mechani=
 cs
 >  >    is too much for emergency crash dump code path
 >  =

 >  Would it be reasonable to open wd1b when it is configured as dump
 >  device? I assume if it is also a swap device, it works fine?

 this seems like the best way to solve this sanely, though i suspect
 it will require some hacks to avoid double-open when also swap device,
 but since uvm_swap.c handles these, it should be fairly local hack,
 though it will need to handle both dump or swap having the partition
 open first, since the admin can set either in any order.


 .mrg.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.