Bug 3553 - the -L option of tar does not work properly with long tape lengths
Summary: the -L option of tar does not work properly with long tape lengths
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: gnu (show other bugs)
Version: 2.2.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-05-09 02:30 UTC by aloke
Modified: 2002-05-29 01:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aloke 1997-05-09 02:30:03 UTC
GNU tar version 1.11.2. The -L option to tar is supposed to specify the length of the tape in K,
but when the number is large (I was using 3145000 to specify a 3Gig tape)
the user is prompted to mount a second volume too soon. A look
at the source shows the tape_length variable to be a signed int, instead
of unsigned.

Fix: 

in /usr/src/gnu/usr.bin/tar/buffer.c changed 
"static long bytes_written = 0;" to "static unsigned long bytes_written = 0; "

in /usr/src/gnu/usr.bin/tar/tar.h changed
"TAR_EXTERN int tape_length;" to "TAR_EXTERN unsigned long tape_length;"
How-To-Repeat: tar -c -v -M -L 3145000 -f /dev/rst0 .
where "." is populated with some large files (in my case, 2 files
of 64 Meg and 44 Meg). tar will ask for the 2nd volume to be written
MUCH before having written 3gigs.
Comment 1 jkh freebsd_committer freebsd_triage 1997-05-09 05:26:59 UTC
State Changed
From-To: open->closed

This is a duplicate of PR#3552.  Please only submit bug 
reports once.  Thanks. 

Comment 2 Joerg Wunsch 1997-05-09 09:32:00 UTC
As aloke@vicor-nb.com wrote:

> GNU tar version 1.11.2. The -L option to tar is supposed to specify
> the length of the tape in K, but when the number is large (I was
> using 3145000 to specify a 3Gig tape) the user is prompted to mount
> a second volume too soon. A look at the source shows the tape_length
> variable to be a signed int, instead of unsigned.

That won't help very much.  Bumping the limit from 2 GB to 4 GB
probably ain't worth the while.  Either, it should be made a 64-bit
entity at all (but that's probably quite a little more of work), or
it's too small for many current tape drives already.

Silly question: why do you want to specify -L at all?  It is only
required for broken hardware/drivers.  The floppy disk driver used to
be broken until FreeBSD 2.2 and required it, but to the best of my
knowledge, the tape drivers were always able to correctly report EOF
back to the caller.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
Comment 3 Joerg Wunsch 1997-05-09 09:32:00 UTC
As aloke@vicor-nb.com wrote:

> GNU tar version 1.11.2. The -L option to tar is supposed to specify
> the length of the tape in K, but when the number is large (I was
> using 3145000 to specify a 3Gig tape) the user is prompted to mount
> a second volume too soon. A look at the source shows the tape_length
> variable to be a signed int, instead of unsigned.

That won't help very much.  Bumping the limit from 2 GB to 4 GB
probably ain't worth the while.  Either, it should be made a 64-bit
entity at all (but that's probably quite a little more of work), or
it's too small for many current tape drives already.

Silly question: why do you want to specify -L at all?  It is only
required for broken hardware/drivers.  The floppy disk driver used to
be broken until FreeBSD 2.2 and required it, but to the best of my
knowledge, the tape drivers were always able to correctly report EOF
back to the caller.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
Comment 4 perisa 2002-05-29 01:43:34 UTC
Please close this PR. It is better described at

http://www.freebsd.org/cgi/query-pr.cgi?pr=gnu/24903

Thanks

Marc