From sime@logos.hr  Fri Dec 12 01:50:29 2003
Return-Path: <sime@logos.hr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3922016A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Dec 2003 01:50:29 -0800 (PST)
Received: from mail.logos.hr (gates.logos.hr [213.149.47.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AF2F343D39
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Dec 2003 01:50:22 -0800 (PST)
	(envelope-from sime@logos.hr)
Received: from localhost (localhost.logos.hr [127.0.0.1])
	by mail.logos.hr (Postfix) with ESMTP id E67191CC79
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Dec 2003 10:50:18 +0100 (CET)
Received: from mail.logos.hr ([127.0.0.1])
 by localhost (mail.logos.hr [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 88308-02-4 for <FreeBSD-gnats-submit@freebsd.org>;
 Fri, 12 Dec 2003 10:50:15 +0100 (CET)
Received: by mail.logos.hr (Postfix, from userid 34062)
	id 7FAE71CC85; Fri, 12 Dec 2003 10:50:15 +0100 (CET)
Message-Id: <20031212095015.7FAE71CC85@mail.logos.hr>
Date: Fri, 12 Dec 2003 10:50:15 +0100 (CET)
From: Simun Mikecin <sime@logos.hr>
Reply-To: Simun Mikecin <sime@logos.hr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: 5.2-RC: disk errors cause panic in softupdates code
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         60175
>Category:       kern
>Synopsis:       panic: 5.2-RC: disk errors cause panic in softupdates code
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 12 02:00:21 PST 2003
>Closed-Date:    Sun Mar 11 09:06:36 GMT 2007
>Last-Modified:  Sun Mar 11 09:06:36 GMT 2007
>Originator:     Simun Mikecin
>Release:        FreeBSD 5.2-RC i386
>Organization:
>Environment:
System: FreeBSD data.home.hr 5.2-RC FreeBSD 5.2-RC #0: Thu Dec 11 13:41:50 CET 2003 root@data.home.hr:/usr/obj/usr/src/sys/DATA i386


	
>Description:
	It looks softupdates code doesn't like disk errors of any kind. I
	get panic that says:
		"softdep_move_dependencies: need merge code"

	It can be found in /sys/ufs/ffs/ffs_softdep.c
	This is what I tried:

	1) I have a floppy that has some bad sectors. Making UFS2 filesystem
	with softupdates enabled on that floppy, and trying to write some
	files to it causes a panic (before that I get few error reports in
	dmesg). If I try it with softupdates disabled I only get errors in
	dmesg and partially corrupted filesystem, but no panic.

	2) I have a DVD media with UFS2 filestem on it (tunefs -p says
	softupdates are enabled). I put it in a DVD-ROM drive (that can only
	read), mount it read-only and everything works OK. But If I don't
	use '-ur' as a mount option it will be mounted read-write (which is
	default).  System will even let me write files to the mounted file
	system (at least it looks that way, nothing can really be written to
	the media). After some time errors show in dmesg saying that WRITE
	operation is not permitted, but after some time I get a panic.  If I
	try the same thing with DVD media that was written with softupdates
	disabled, no panic occurs.

	3) I tried using DVD+RW media on ATAPI DVD burner by using
	bsdlabel/newfs/mount. Doing it by using "acd" device implemented in
	atapi-cd.c works ok. But using it by using SCSI emulation layer
	(device "cd") atapi-cam.c produces errors ("Logical unit not ready,
	long write in progress") when writing to the media (I think this is
	a well known bug by now). So I suppose it then behaves to the
	VFS/FFS layer like a media with bad sectors. Again it panics after
	some time of writing to it only when softupdates are enabled.

	Those three scenarios I tried are not very important but I suppose
	it would be the same with a hard disk that has some sectors gone
	bad, or that has trouble reading/writing of any kind, which would be
	a very bad thing.

>How-To-Repeat:
	Try one of the scenarios from above.

>Fix:
	Disable softupdates, until softupdates code gets better.
	
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Sun Jan 8 15:44:05 UTC 2006 
State-Changed-Why:  
Would you please open 3 different PR's for those 3 different problems 
and report back when you created them, so this PR can be closed? 

The second one may already be fixed in 6-stable and maybe 5-stable too. 
Would you please test before reporting this one? 

Regarding the third one: I don't know if it's fixed or not, so it would 
be nice if you could test it too. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60175 

From: =?iso-8859-2?Q?=A9imun_Mikecin?= <simun.mikecin@logos.hr>
To: "Alexander Leidinger" <netchild@FreeBSD.org>,
	<bug-followup@freebsd.org>
Cc:  
Subject: RE: kern/60175: panic: 5.2-RC: disk errors cause panic in softupdates code
Date: Tue, 10 Jan 2006 10:41:26 +0100

 I submitted kern/91568 and kern/91572 for scenarios 2 and 3.
 I couldn't reproduce first scenario cause I'm missing a floppy disk with =
 bad sectors to test it with.
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Sun Mar 11 09:06:35 UTC 2007 
State-Changed-Why:  
The new tickets had been opened, the first problem cannot be resolved 
anymore (no badsector floppies). Closing this ticket, if someone has 
feedback for the floppy part, please notify me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60175 
>Unformatted:
