From owner-freebsd-bugs Thu Oct 17 02:20:08 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA18834 for bugs-outgoing; Thu, 17 Oct 1996 02:20:08 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA18801; Thu, 17 Oct 1996 02:20:05 -0700 (PDT) Resent-Date: Thu, 17 Oct 1996 02:20:05 -0700 (PDT) Resent-Message-Id: <199610170920.CAA18801@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, akiyama@kme.mei.co.jp Received: from vcgate1.mei.co.jp (vcgate1.mei.co.jp [202.32.14.51]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id CAA18637 for ; Thu, 17 Oct 1996 02:17:13 -0700 (PDT) Received: by vcgate1.mei.co.jp (5.65mei1.2g/5.9:4.9:vcgate0:960909) id AA03599; Thu, 17 Oct 96 18:17:09 +0900 Received: by vcmei.vanc.mei.co.jp (5.65mei1.1/5.9:4.9:vcmei:961015) id AA22742; Thu, 17 Oct 96 17:04:34 +0900 Received: by kmegate.kme.mei.co.jp (4.1/5.5:4.6:kmegate:960604) id AA09955; Thu, 17 Oct 96 16:44:01 JST Message-Id: <9610170744.AA09955@kmegate.kme.mei.co.jp> Date: Thu, 17 Oct 96 16:44:01 JST From: akiyama@kme.mei.co.jp Reply-To: akiyama@kme.mei.co.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/1830: Can't mount optical disk, after different size media was unmounted. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: