Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 96 16:44:01 JST
From:      akiyama@kme.mei.co.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/1830: Can't mount optical disk, after different size media was unmounted.
Message-ID:  <9610170744.AA09955@kmegate.kme.mei.co.jp>
Resent-Message-ID: <199610170920.CAA18801@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1830
>Category:       kern
>Synopsis:       Can't mount optical disk, after different size media was unmounted.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 17 02:20:02 PDT 1996
>Last-Modified:
>Originator:     Shunsuke Akiyama
>Organization:
Kyushu Matsushita Electric Co., Ltd.
>Release:        FreeBSD 2.2-961006-SNAP i386
>Environment:

	All 2.2-961006-SNAP or later systems configured with od.

>Description:

	Modification from previous revision of "sys/scsi/od.c"
	disables detecting media changing.  Therefor the driver never
	replace on-core disklabel even if another media is loaded.
	Then mounting media which have different disklabel from
	previous mounted one.

>How-To-Repeat:

	Mount an optical disk media.  Then unmount and eject it.
	Mount another optical disk media which disklabel is different
	from previous mounted media in size.

>Fix:
	
	This patch fix the problem.

===================================================================
RCS file: sys/scsi/RCS/od.c,v
retrieving revision 1.22
retrieving revision 1.22.1.1
diff -u -r1.22 -r1.22.1.1
--- sys/scsi/od.c	1996/09/06 23:09:11	1.22
+++ sys/scsi/od.c	1996/10/13 07:39:55	1.22.1.1
@@ -309,18 +309,18 @@
 		dev, unit, PARTITION(dev)));
 
 	/*
-	 * Try to start the drive (ignore failure).
+	 * Try to start the drive, and try to clear "Unit Attention"
+	 * condition, when media had been changed before.
+	 * This operation also clears the SDEV_MEDIA_LOADED flag in its
+	 * error handling routine.
 	 */
-	scsi_start_unit(sc_link, SCSI_ERR_OK | SCSI_SILENT);
+	scsi_start_unit(sc_link, SCSI_SILENT);
 	scsi_prevent(sc_link, PR_PREVENT, SCSI_ERR_OK | SCSI_SILENT);
 
 	/*
-	 * Try to clear "Unit Attention" condition, when media had
-	 * been changed	before.
-	 * This operation also clears the SDEV_MEDIA_LOADED flag in its
-	 * error handling routine.
+	 * Make sure the drive is ready.
 	 */
-	scsi_test_unit_ready(sc_link, SCSI_SILENT);
+	scsi_test_unit_ready(sc_link, 0);
 
 	SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted "));
 
@@ -361,9 +361,7 @@
 	switch (od->params.secsiz) {
 	case SECSIZE :
 	case 1024 :
-#ifdef notyet
 	case 2048 :
-#endif
 		break;
 	default :
 		printf("od%ld: Can't deal with %d bytes logical blocks\n",
@@ -962,5 +960,3 @@
 }
 
 SYSINIT(oddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,od_drvinit,NULL)
-
-
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9610170744.AA09955>