NetBSD Problem Report #40528

From www@NetBSD.org  Sat Jan 31 22:50:04 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id EBD0863BC01
	for <gnats-bugs@gnats.netbsd.org>; Sat, 31 Jan 2009 22:50:03 +0000 (UTC)
Message-Id: <20090131225003.B339463B879@narn.NetBSD.org>
Date: Sat, 31 Jan 2009 22:50:03 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: cd(4) hang
X-Send-Pr-Version: www-1.0

>Number:         40528
>Category:       kern
>Synopsis:       cd(4) read_cd_capacity hang
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    reinoud
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 31 22:55:00 +0000 2009
>Closed-Date:    Tue Mar 17 21:28:14 +0000 2009
>Last-Modified:  Tue Mar 24 20:20:03 +0000 2009
>Originator:     Antti Kantee
>Release:        5.0_BETA
>Organization:
>Environment:
>Description:
In some circumstances, the cd driver can hang a userspace process
when ioctl(2) is called.  The process stack trace, copied
by hand from ddb, is (relevant parts only):
  cdioctl
  mmc_getdiscinfo
  read_cd_capacity
  scsipi_execute_xs
  sleepq_block

And the process hangs with the "xscmd" wchan.
>How-To-Repeat:
maybe: run rump_udf, copy large file to the file system, decide to abort
and accidentally kill rump_udf instead of the cp, try to remount,
observe stuck unkillable process.
>Fix:
unknown

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->reinoud
Responsible-Changed-By: dyoung@NetBSD.org
Responsible-Changed-When: Tue, 17 Mar 2009 18:28:40 +0000
Responsible-Changed-Why:
reinoud@ says that I can assign this to him.


State-Changed-From-To: open->closed
State-Changed-By: reinoud@NetBSD.org
State-Changed-When: Tue, 17 Mar 2009 21:28:14 +0000
State-Changed-Why:
Fixed by cd.c 1.289; turned out to be a missing synchronise caches call on device closure when (ab)used by 'dd' for writing a CD/DVD.


From: Reinoud Zandijk <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40528 CVS commit: src/sys/dev/scsipi
Date: Tue, 17 Mar 2009 21:25:47 +0000

 Module Name:	src
 Committed By:	reinoud
 Date:		Tue Mar 17 21:25:47 UTC 2009

 Modified Files:
 	src/sys/dev/scsipi: cd.c

 Log Message:
 Fix long standing problem with CD/DVD writing with `dd'. If done this way the
 device will remain in a wait-for-more-stuff-to-be-written state delaying other
 SCSI calls, esp. some read-size or read-layout calls, until its told there is
 no more comming.

 To fix this, on last close explicitly flush the caches releasing the device
 from this mode and allowing other SCSI commands to reach it.

 This fixes PR 40528


 To generate a diff of this commit:
 cvs rdiff -u -r1.288 -r1.289 src/sys/dev/scsipi/cd.c

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

From: David Young <dyoung@pobox.com>
To: gnats-bugs@NetBSD.org
Cc: reinoud@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	pooka@iki.fi
Subject: Re: PR/40528 CVS commit: src/sys/dev/scsipi
Date: Tue, 17 Mar 2009 18:34:23 -0500

 On Tue, Mar 17, 2009 at 09:30:04PM +0000, Reinoud Zandijk wrote:
 > The following reply was made to PR kern/40528; it has been noted by GNATS.
 > 
 > From: Reinoud Zandijk <reinoud@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/40528 CVS commit: src/sys/dev/scsipi
 > Date: Tue, 17 Mar 2009 21:25:47 +0000
 > 
 >  Module Name:	src
 >  Committed By:	reinoud
 >  Date:		Tue Mar 17 21:25:47 UTC 2009
 >  
 >  Modified Files:
 >  	src/sys/dev/scsipi: cd.c
 >  
 >  Log Message:
 >  Fix long standing problem with CD/DVD writing with `dd'. If done this way the
 >  device will remain in a wait-for-more-stuff-to-be-written state delaying other
 >  SCSI calls, esp. some read-size or read-layout calls, until its told there is
 >  no more comming.
 >  
 >  To fix this, on last close explicitly flush the caches releasing the device
 >  from this mode and allowing other SCSI commands to reach it.
 >  
 >  This fixes PR 40528

 This fixes the 'eject cd0' problem that I reported in kern/40998, too.
 Thanks!

 Dave

 -- 
 David Young             OJC Technologies
 dyoung@ojctech.com      Urbana, IL * (217) 278-3933

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40528 CVS commit: [netbsd-5] src/sys/dev/scsipi
Date: Tue, 24 Mar 2009 20:16:59 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Tue Mar 24 20:16:58 UTC 2009

 Modified Files:
 	src/sys/dev/scsipi [netbsd-5]: cd.c

 Log Message:
 Pull up following revision(s) (requested by reinoud in ticket #586):
 	sys/dev/scsipi/cd.c: revision 1.289
 Fix long standing problem with CD/DVD writing with `dd'. If done this way the
 device will remain in a wait-for-more-stuff-to-be-written state delaying other
 SCSI calls, esp. some read-size or read-layout calls, until its told there is
 no more comming.
 To fix this, on last close explicitly flush the caches releasing the device
 from this mode and allowing other SCSI commands to reach it.
 This fixes PR 40528


 To generate a diff of this commit:
 cvs rdiff -u -r1.283 -r1.283.4.1 src/sys/dev/scsipi/cd.c

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.