From nobody@FreeBSD.org  Mon Nov  8 05:00:57 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1BFA816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Nov 2004 05:00:57 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id ED0CF43D39
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Nov 2004 05:00:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id iA850tUs069882
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 8 Nov 2004 05:00:55 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id iA850sh3069881;
	Mon, 8 Nov 2004 05:00:54 GMT
	(envelope-from nobody)
Message-Id: <200411080500.iA850sh3069881@www.freebsd.org>
Date: Mon, 8 Nov 2004 05:00:54 GMT
From: Dierk Sacher <usenet01@blaxxtarz.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: geom_mirror hanging on boot because of cdrom in drive, causes mirror to degrade
X-Send-Pr-Version: www-2.3

>Number:         73660
>Category:       kern
>Synopsis:       geom_mirror hanging on boot because of cdrom in drive, causes mirror to degrade
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pjd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 08 05:10:24 GMT 2004
>Closed-Date:    Mon Nov 08 11:22:36 GMT 2004
>Last-Modified:  Mon Nov 08 11:22:36 GMT 2004
>Originator:     Dierk Sacher
>Release:        5.3-RELEASE
>Organization:
DSITC
>Environment:
FreeBSD 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov  5 04:19:18 UTC 2004 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The ATA Layout:
  C0-master: ad0
  C0-slave : acd0
  C1-master: ad2
  C1-master: -none-

A geom_mirror is set up with providers ad0 and ad2. The mirror contains a full slice with all partitions.

On load of geom_mirror, there are errors:
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 error=4<ABORTED>

This _only_ happens, if I have a medium in the cdrom drive.

On boot, the activation of ad0 hangs, because of the error on acd0. What seems to happen is, that the default mirror.timout=4 forces the mirror 
to start without ad0. 

The mirror comes up not only in degraded state, but ad0 is missing at all. I'm able to reattach the ad0 provider, but this causes a full resync of the mirror.

Syslog:
..
ad0: 114473MB <ST3120022A/8.01> [232581/16/63] at ata0-master UDMA100
GEOM_MIRROR: Device gm0 created (id=285889984).
GEOM_MIRROR: Device gm0: provider ad0 detected.
acd0: CDROM <SAMSUNG CD-ROM SH-152A/C503> at ata0-slave UDMA33
ad2: 114473MB <ST3120022A/8.01> [232581/16/63] at ata1-master UDMA100
GEOM_MIRROR: Force device gm0 start due to timeout.
GEOM_MIRROR: Device gm0 destroyed.
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 error=4<ABORTED>
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 error=4<ABORTED>
GEOM_MIRROR: Device gm0 created (id=285889984).
GEOM_MIRROR: Device gm0: provider ad2 detected.
GEOM_MIRROR: Force device gm0 start due to timeout.
GEOM_MIRROR: Device gm0: provider ad2 activated.
GEOM_MIRROR: Device gm0: provider mirror/gm0 launched.
Mounting root from ufs:/dev/mirror/gm0s1a
..
>How-To-Repeat:
Have a CDROM drive on same IDE channel with a geom_mirror provider &&
Have a medium in drive &&
Boot with synced mirror.

>Fix:
Fix unknown (not a kernel developer,sry)

Workarround:
In device.hints, set kern.geom_mirror.timeout=30 (??? someone able to confirm that this isn't bogus? I'm not shure about this one.)
  or
Do not have a medium in your CDROM
  or
Do not have a CDROM Drive together with a geom providing harddrive on the same Channel at all.

Syslog with CDROM in Drive _and_ higher Timeout:
ad0: 114473MB <ST3120022A/8.01> [232581/16/63] at ata0-master UDMA100
GEOM_MIRROR[1]: Creating device gm0 (id=285889984).
GEOM_MIRROR[0]: Device gm0 created (id=285889984).
GEOM_MIRROR[1]: Adding disk ad0 to gm0.
GEOM_MIRROR[1]: Disk ad0 state changed from NONE to NEW (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad0 detected.
acd0: CDROM <SAMSUNG CD-ROM SH-152A/C503> at ata0-slave UDMA33
ad2: 114473MB <ST3120022A/8.01> [232581/16/63] at ata1-master UDMA100
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 error=4<ABORTED>
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 error=4<ABORTED>
GEOM_MIRROR[1]: Adding disk ad2 to gm0.
GEOM_MIRROR[1]: Disk ad2 state changed from NONE to NEW (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad2 detected.
GEOM_MIRROR[1]: Device gm0 state changed from STARTING to RUNNING.
GEOM_MIRROR[1]: Disk ad2 state changed from NEW to ACTIVE (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad2 activated.
GEOM_MIRROR[1]: Disk ad0 state changed from NEW to ACTIVE (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad0 activated.
GEOM_MIRROR[0]: Device gm0: provider mirror/gm0 launched.
Mounting root from ufs:/dev/mirror/gm0s1a
GEOM_MIRROR[1]: Disk ad2 (device gm0) marked as dirty.
GEOM_MIRROR[1]: Disk ad0 (device gm0) marked as dirty.

Syslog without a medium in the CDROM drive:
ad0: 114473MB <ST3120022A/8.01> [232581/16/63] at ata0-master UDMA100
GEOM_MIRROR[1]: Creating device gm0 (id=285889984).
GEOM_MIRROR[0]: Device gm0 created (id=285889984).
GEOM_MIRROR[1]: Adding disk ad0 to gm0.
GEOM_MIRROR[1]: Disk ad0 state changed from NONE to NEW (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad0 detected.
acd0: CDROM <SAMSUNG CD-ROM SH-152A/C503> at ata0-slave UDMA33
ad2: 114473MB <ST3120022A/8.01> [232581/16/63] at ata1-master UDMA100
GEOM_MIRROR[1]: Adding disk ad2 to gm0.
GEOM_MIRROR[1]: Disk ad2 state changed from NONE to NEW (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad2 detected.
GEOM_MIRROR[1]: Device gm0 state changed from STARTING to RUNNING.
GEOM_MIRROR[1]: Disk ad2 state changed from NEW to ACTIVE (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad2 activated.
GEOM_MIRROR[1]: Disk ad0 state changed from NEW to ACTIVE (device gm0).
GEOM_MIRROR[0]: Device gm0: provider ad0 activated.
GEOM_MIRROR[0]: Device gm0: provider mirror/gm0 launched.
Mounting root from ufs:/dev/mirror/gm0s1a
GEOM_MIRROR[1]: Disk ad2 (device gm0) marked as dirty.
GEOM_MIRROR[1]: Disk ad0 (device gm0) marked as dirty.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pjd 
Responsible-Changed-By: simon 
Responsible-Changed-When: Mon Nov 8 10:08:38 GMT 2004 
Responsible-Changed-Why:  
Over to geom_mirror author. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73660 
State-Changed-From-To: open->closed 
State-Changed-By: pjd 
State-Changed-When: Mon Nov 8 11:13:35 GMT 2004 
State-Changed-Why:  
This is not a problem in gmirror actually and you are correct that 
you should increase timeout, because it should be increased if you 
have slow media such as CD-ROM, floppy, etc. 
You should put kern.geom.mirror.timeout into /boot/loader.conf 
instead of device.hints. 

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