pthread problem writing tapes

Kern Sibbald kern at sibbald.com
Fri Aug 22 12:54:56 PDT 2003


Hello,

> On Wed, 20 Aug 2003, Nate Lawson wrote:

>> This appears to be a pthreads problem, not scsi.  Anyone care to look at
>> it?

> This will be an interesting fix ... since pthreads use non-blocking file
> descriptors underneath, fixing it may involve changing the semantics of
> non-blocking files.

>> The interesting thing is that when the program
>> works, it gets a 0 status on a write, which
>> indicates that the tape is at the end of the
>> Logical EOF marker (or in other words, the
>> tape is almost full):

> I'm kind of curious what he's referring to here.  

Yes, I'm sorry, my description was not very clear or accurate.

What I wanted to say is that when writing to a tape at some
point you get a zero status back (i.e. no bytes written) this
indicates to the program that the logical end of tape (not EOF as
I wrote) has been reached. The logical end of tape is a marker
on the tape before the physical end of the tape.
If you stop writing when the logical end of tape is reached,
you are more or less guaranteed that any buffered blocks
will be correctly written to the tape.  If you continue writing
you eventually reach the physical end of the tape and the O/S
returns a -1 status and errno=ENOSPC.

> There are no EOF markers unless you write them yourself.  
> Does bakula require you to stripe tapes
> before use?

> -- 
> Doug White                    |  FreeBSD: The Power to Serve
> dwhite at gumbysoft.com          |  www.FreeBSD.org

Best regards,

Kern



More information about the freebsd-threads mailing list