From owner-freebsd-questions Wed Jun 21 15:12:11 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA10132 for questions-outgoing; Wed, 21 Jun 1995 15:12:11 -0700 Received: from localhost.cdrom.com (localhost.cdrom.com [127.0.0.1]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id PAA10122 ; Wed, 21 Jun 1995From owner-freebsd-questions Wed Jun 21 15:49:44 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA11629 for questions-outgoing; Wed, 21 Jun 1995 15:49:44 -0700 Received: from mpp.com (mpp.Minn.Net [204.157.201.242]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id PAA11623 ; Wed, 21 Jun 1995 15:49:41 -0700 Received: (from mpp@localhost) by mpp.com (8.6.11/8.6.9) id RAA00258; Wed, 21 Jun 1995 17:49:29 -0500 From: Mike Pritchard Message-Id: <199506212249.RAA00258@mpp.com> Subject: Re: FBSD 2.xR: AIC7xxx driver vs. st() driver vs. tape drives To: deischen@iworks.InterWorks.org (Daniel M. Eischen) Date: Wed, 21 Jun 1995 17:49:29 -0500 (CDT) Cc: gibbs@freebsd.org, mikebo@TELLABS.COM, questions@freebsd.org In-Reply-To: <9506212000.AA13314@iworks.InterWorks.org> from "Daniel M. Eischen" at Jun 21, 95 03:00:56 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2515 Sender: questions-owner@freebsd.org Precedence: bulk > >DEBUG: Notify: Attempting to extract from SCSI tape drive... > >DEBUG: Executing command 'cpio -iBduVm -H tar -I /dev/rst0' (Magic 0) > >st0(ahc1:2:0): ILLEGAL REQUEST > >st0: Cannot set selected mode > >st0: bad request, must be between 0 and 0 > >cpio: read error: Input/output error > >DEBUG: Command 'cpio -iBduVm -H tar -I /dev/rst0' returns status of 1 Are you booting with a tape in the drive? I just tracked down the "bad request, must be between 0 and 0" problem that I've seen before. If a tape is in the drive at boot time, st_mode_sense is called and sets the MEDIA_LOADED flag. When st_mount_tape is called and then calls st_rd_blk_lim, st_rd_blk_lim sees the MEDIA_LOADED flag and returns without doing anything, thus causing the above error. I fixed it by changing st_mode_sense to not set the MEDIA_LOADED flag, since st_mount_tape sets it when the mount is complete, and other code in the driver causes the MEDIA_LOADED flag to track the mount status, so changing the mode_sense routine to not fiddle with the MEDIA_LOADED flag seemed like the thing to do. I also removed the MEDIA_LOADED check from st_rd_blk_lim, since it is only called by st_mount_tape, and it makes sense to always read this information when mounting a new tape, just in cause the MEDIA_LOADED flag got confused somewhere along the way. Here is a patch to fix the problem (it also fixes a typo). It may also fix/or help the problem described in PR misc/531. *** orig/st.c Wed Jun 21 17:09:04 1995 --- st.c Wed Jun 21 17:21:42 1995 *************** *** 1017,1023 **** st->buf_queue = bp->b_actf; /* ! * if the device has been unmounted byt the user * then throw away all requests until done */ if ((!(st->flags & ST_MOUNTED)) --- 1017,1023 ---- st->buf_queue = bp->b_actf; /* ! * if the device has been unmounted by the user * then throw away all requests until done */ if ((!(st->flags & ST_MOUNTED)) *************** *** 1359,1370 **** errval errno; /* - * First check if we have it all loaded - */ - if ((sc_link->flags & SDEV_MEDIA_LOADED)) - return 0; - - /* * do a 'Read Block Limits' */ bzero(&scsi_cmd, sizeof(scsi_cmd)); --- 1359,1364 ---- *************** *** 1481,1487 **** if (page) { bcopy(&dat.page, page, pagelen); } - sc_link->flags |= SDEV_MEDIA_LOADED; return 0; } --- 1475,1480 ---- -- Mike Pritchard mpp@legarto.minn.net "Go that way. Really fast. If something gets in your way, turn"