From koeck@fbsd  Sat Jun 17 07:32:20 1995
Received: from fbsd ([149.217.6.5])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id HAA24722
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Jun 1995 07:32:19 -0700
Received: (from koeck@localhost) by fbsd (8.6.11/8.6.9) id QAA03118; Sat, 17 Jun 1995 16:32:37 +0200
Message-Id: <199506171432.QAA03118@fbsd>
Date: Sat, 17 Jun 1995 16:32:37 +0200
From: koeck@pluto.mpi-hd.mpg.de
Reply-To: koeck@pluto.mpi-hd.mpg.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: dump causes assertion in ncr.c
X-Send-Pr-Version: 3.2

>Number:         527
>Category:       kern
>Synopsis:       dump causes assertion in ncr.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dufault
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 17 07:40:02 1995
>Closed-Date:    Tue Jun 22 06:57:20 PDT 1999
>Last-Modified:  Tue Jun 22 06:57:58 PDT 1999
>Originator:     Frank Koeck
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
Max-Planck-Institut fuer Kernphysik, Heidelberg, Germany
>Environment:

Pentium 90 System with 

	32 MB Ram, 
	ELSA Winner 1000,
	NCR 53c810 SCSI Adapter,
	Elite Ethernet Card with Digital DC21040 Chip
	HP C1533A DAT Drive,
	IBM DPES-31080 Disk

	FreeBSD 2.0.5-R


>Description:

The dump command will cause kernel assertion messages of the ncr scsi 
driver to be printed out. Appended is the printout of two examples showing 
the kernel message produced by ncr.c. It is possible to restore a previously
written dump without a problem.
 
1. Example: dump to /dev/rst0 (DAT) :
=====================================

bash# dump 0fds /dev/nrst0 10000 10000 /
  DUMP: Date of this level 0 dump: Sat Jun 17 15:22:14 1995
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rsd0a (/) to /dev/nrst0
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 13396 tape blocks on 0.01 tape(s).
  DUMP: dumping (Pass III) [directories]
Jun 17 15:22:22 fbsd /kernel: assertion "cp == np->header.cp" failed: file "../.
./pci/ncr.c", line 5395
Jun 17 15:22:22 fbsd /kernel: assertion "cp == np->header.cp" failed: file "../.
./pci/ncr.c", line 5395
Jun 17 15:22:22 fbsd /kernel: assertion "cp" failed: file "../../pci/ncr.c", lin
e 5396
Jun 17 15:22:22 fbsd /kernel: assertion "cp" failed: file "../../pci/ncr.c", lin
e 5396
  DUMP: dumping (Pass IV) [regular files]
  DUMP: DUMP: 13407 tape blocks on 1 volumes(s)
  DUMP: Closing /dev/nrst0
  DUMP: DUMP IS DONE


2. Example: dump to /dev/null:
==============================
bash# dump 0fds /dev/null 10000 10000 /
  DUMP: Date of this level 0 dump: Sat Jun 17 15:24:16 1995
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rsd0a (/) to /dev/null
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 13396 tape blocks on 0.01 tape(s).
  DUMP: dumping (Pass III) [directories]
Jun 17 15:24:24 fbsd /kernel: assertion "cp == np->header.cp" failed: file "../.
./pci/ncr.c", line 5395
Jun 17 15:24:24 fbsd /kernel: assertion "cp == np->header.cp" failed: file "../.
./pci/ncr.c", line 5395
Jun 17 15:24:24 fbsd /kernel: assertion "cp" failed: file "../../pci/ncr.c", lin
e 5396
Jun 17 15:24:24 fbsd /kernel: assertion "cp" failed: file "../../pci/ncr.c", lin
e 5396
  DUMP: dumping (Pass IV) [regular files]
  DUMP: DUMP: 13407 tape blocks on 1 volumes(s)
  DUMP: Closing /dev/null
  DUMP: DUMP IS DONE

>How-To-Repeat:

see above

>Fix:
	
	

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: se 
State-Changed-When: Wed Feb 7 14:58:00 PST 1996 
State-Changed-Why:  
This appears to be caused by the generic SCSI code sending a  
START STOP UNIT command at each open of the raw disk device. 
Two programs are known to possibly open such a device multiple 
times within a fraction of a second: DUMP and FSCK. 
The NCR driver sends these commands with ORDERED TAG messages, 
which appears to confuse some IBM drives, if several are issued 
concurrently. 

This should be changed in the generic SCSI code, which easily 
could count the number of times a device has been opened and 
which should start the drive only once. 
Responsible-Changed-From-To: freebsd-bugs->dufault 
Responsible-Changed-By: pst 
Responsible-Changed-When: Thu Feb 8 09:37:03 PST 1996 
Responsible-Changed-Why:  
Peter has a fix being tested. 
Peter, when you're happy, please apply the fix and close out this bug. 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: phk 
State-Changed-When: Sun Apr 12 10:48:38 PDT 1998 
State-Changed-Why:  
Is this still a problem ? 
State-Changed-From-To: feedback->closed 
State-Changed-By: sheldonh 
State-Changed-When: Tue Jun 22 06:57:20 PDT 1999 
State-Changed-Why:  
Timed out waiting for feedback from submitter. 
>Unformatted:


