From owner-freebsd-scsi@FreeBSD.ORG Tue Jul 29 19:18:31 2014 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5475D54B; Tue, 29 Jul 2014 19:18:31 +0000 (UTC) Received: from uriah.heep.sax.de (uriah.heep.sax.de [IPv6:2a01:170:1047::9]) by mx1.freebsd.org (Postfix) with ESMTP id 12AB027E3; Tue, 29 Jul 2014 19:18:31 +0000 (UTC) Received: by uriah.heep.sax.de (Postfix, from userid 107) id 61B6F24C7; Tue, 29 Jul 2014 21:18:29 +0200 (CEST) Date: Tue, 29 Jul 2014 21:18:29 +0200 From: Joerg Wunsch To: freebsd-scsi@freebsd.org Subject: Re: Bacula fails on FreeBSD 10.x / "mt fsf" infinitely proceeds Message-ID: <20140729191829.GK3121@uriah.heep.sax.de> Mail-Followup-To: Joerg Wunsch , freebsd-scsi@freebsd.org, Martin Simmons , "Kenneth D. Merry" References: <20140729090724.GA26577@uriah.heep.sax.de> <201407291823.s6TINAad032318@higson.cam.lispworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407291823.s6TINAad032318@higson.cam.lispworks.com> X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-GPG-Fingerprint: 5E84 F980 C3CA FD4B B584 1070 F48C A81B 69A8 5873 User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "Kenneth D. Merry" X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 19:18:31 -0000 As Martin Simmons wrote: > Maybe you are now connecting the tape drive via a different SCSI > driver? No, I forgot to say: the tape drive/library is a Sun L9 which has HV-Diff-SCSI, so I have to use the exact same Symbios Logic SCSI controller (and driver) as before. > It sounds like you are running Bacula with "Fast Forward Space File > = yes" in the configuration. Yes, that's the case. However, even without that, I'm afraid the Bacula logic would run into an infinite loop, as a single FSF operation now always succeeds, and pretends it encountered a new tape file. (Besides, the "Fast Forward Space File" thing did work for many years.) Looking into saspace() in sys/cam/scsi/scsi_sa.c, I see: ==================================================================== } else if (code == SS_FILEMARKS && softc->fileno != (daddr_t) -1) { softc->fileno += (count - softc->last_ctl_resid); if (softc->fileno < 0) /* we must of hit BOT */ softc->fileno = 0; softc->blkno = 0; ==================================================================== That piece of code ought to be responsible when the SPACE command hit a filemark. It hasn't been changed for more than a decade though. Now the following SVN log message rang a bell to me: ==================================================================== r225950 | ken | 2011-10-03 22:32:55 +0200 (Mo, 03. Okt 2011) | 146 Zeilen Add descriptor sense support to CAM, and honor sense residuals properly in CAM. ==================================================================== It went in after my older (working) 8.2 system, it talks about residual handling, and the code above uses "softc->last_ctl_resid". It wouldn't surprise me if that's somehow related to the issue. I'm Cc'ing Ken (as the committer of 225950) for an opinion, just in case he doesn't follow the list so closely. -- cheers, Joerg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)