Bacula fails on FreeBSD 10.x / "mt fsf" infinitely proceeds

Joerg Wunsch freebsd-scsi at uriah.heep.sax.de
Tue Jul 29 19:18:31 UTC 2014


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. ;-)


More information about the freebsd-scsi mailing list