Date: Sat, 19 Jun 2010 11:05:17 -0700 From: Matthew Jacob <mj@feral.com> To: freebsd-scsi@freebsd.org Subject: Re: sa: write returns 0 = LEOM? Message-ID: <4C1D06DD.6090506@feral.com> In-Reply-To: <AANLkTikULvhu5TRVDNAY59UvKII-BuBYBvDe83jQFLXR@mail.gmail.com> References: <AANLkTikULvhu5TRVDNAY59UvKII-BuBYBvDe83jQFLXR@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/16/2010 3:52 PM, Dustin J. Mitchell wrote: > I'm investigating a user bug report in Amanda: > http://forums.zmanda.com/showthread.php?t=2832 > > The problem boils down to a write(2) call for a SCSI tape device > (/dev/nsa0) returning 0 after quite a bit of data and a number of > filemarks have been written. Jean-Louis suspected that this was an > early warning EOM indication, and that a subsequent write() would > succeed, with Amanda having been duly warned that a physical EOM is > coming up. But looking at scsi_sa.c, this doesn't seem to be the > case. It looks like an early warning would result in a successful > write instead, because resid is set to zero. > I did some more thinking and remembering about this- sorry, but it's really been years since I had to think about tape drives. The code in question notes that EOM (end of media) is pending so that the *next* write operation will get a full residual. So, yes, when you got a full residual back (no data moves), but no error, that is an EOM indicator for the user app.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C1D06DD.6090506>