NetBSD Problem Report #35231
From agrier@poofygoof.com Mon Dec 11 03:06:00 2006
Return-Path: <agrier@poofygoof.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 286FA63BA6D
for <gnats-bugs@gnats.NetBSD.org>; Mon, 11 Dec 2006 03:06:00 +0000 (UTC)
Message-Id: <20061211030555.2FF61B3@boromir.poofy.goof.com>
Date: Sun, 10 Dec 2006 19:05:55 -0800 (PST)
From: agrier@poofygoof.com
Reply-To: agrier@poofygoof.com
To: gnats-bugs@NetBSD.org
Subject: sysutils/amanda-server: poor changer support / short reads
X-Send-Pr-Version: 3.95
>Number: 35231
>Category: pkg
>Synopsis: sysutils/amanda-server: poor changer support / short reads
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gdt
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Dec 11 03:10:00 +0000 2006
>Closed-Date: Thu Feb 08 13:33:19 +0000 2007
>Last-Modified: Thu Feb 08 13:33:19 +0000 2007
>Originator: agrier@poofygoof.com
>Release: amanda-server-2.4.4p4nb4
>Organization:
Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com
>Environment:
System: NetBSD boromir.poofy.goof.com 3.0_STABLE NetBSD 3.0_STABLE (GENERIC) #0: Sat Jan 21 21:26:09 PST 2006 agrier@boromir.poofy.goof.com:/amd/aragorn/usr/projects/NetBSD/netbsd-3/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
ahc2 at pci0 dev 9 function 0: Adaptec 2944 Ultra SCSI adapter
ahc2: interrupting at irq 10
ahc2: aic7880: Ultra Wide Channel A, SCSI Id=7, 16/253 SCBs
scsibus1 at ahc2: 16 targets, 8 luns per target
ch0 at scsibus1 target 0 lun 0: <ADIC, Scalar DLT 448, 0114> changer removable
ch0: 17 slots, 2 drives, 1 picker, 1 portal
ch0: async, 8-bit transfers
st0 at scsibus1 target 1 lun 0: <QUANTUM, DLT8000, 0119> tape removable
st0: drive empty
st0: sync (100.00ns offset 8), 16-bit (20.000MB/s) transfers
st1 at scsibus1 target 2 lun 0: <QUANTUM, DLT8000, 0119> tape removable
st1: density code 65, variable blocks, write-enabled
st1: sync (100.00ns offset 8), 16-bit (20.000MB/s) transfers
>Description:
two problems:
1) chg-chio doesn't wait for a tape to come ready after loading it,
which causes subsequent tape manipulations to fail.
2) amanda defaults to 32kB block sizes, but read() will only return 32kB
or smaller results on raw st device if the tape actually contains
<= 32kB blocks.
>How-To-Repeat:
1)
amtape default current
this fails if the loader isn't fast enough, which it isn't for my
DLT8000s. (I assume other people would run into the same problem.)
2)
# write > 32kB blocks to a tape, and rewind it
dd if=/dev/zero of=/dev/rst0 bs=64k count=10
# attempt to run amtapetype on it:
amtapetype -f /dev/nrst0
amtapetype: /dev/nrst0: reading label: Input/output error
and in syslog:
/netbsd: st0: 65536-byte tape record too big for 32768-byte user buffer
>Fix:
for problem #1:
--- changer-src/chg-chio.pl.in.orig 2006-12-11 01:49:49.000000000 +0000
+++ changer-src/chg-chio.pl.in 2006-12-11 01:56:15.000000000 +0000
@@ -281,6 +281,13 @@
print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n";
exit(2);
}
+
+ # wait for tape to load
+ do {
+ print LOG &do_time(), ": waiting for tape to load\n";
+ sleep 30;
+ } while ( system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) );
+
print LOG &do_time(), ": leave: Load\n";
}
@@ -302,8 +309,8 @@
# firmware rev but for now it's safest to just explicitly eject
# the tape before moving the cartridge.
#
- if ( system ("@MT@ @MT_FILE_FLAG@ $tapeDevice offline") ) {
- print "$progname: Warning, failed to eject the tape with '@MT@ @MT_FILE_FLAG@ $tapeDevice offline'\n";
+ if ( system ("$MT $MTF $tapeDevice offline") ) {
+ print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n";
# NB: not fatal; let chio try it's thing
}
@@ -370,7 +377,7 @@
print "<none> mt program not found\n";
exit(1);
}
-print LOG &do_time(), "MT -> $MT $MTF\n";
+print LOG &do_time(), ": MT -> $MT $MTF\n";
system ("$MT $MTF $tapeDevice rewind")
unless $currentTape == 0;
for problem #2:
Index: sysutils/amanda-common/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/amanda-common/Makefile.common,v
retrieving revision 1.23
diff -u -r1.23 Makefile.common
--- sysutils/amanda-common/Makefile.common 2 Oct 2006 21:05:44 -0000 1.23
+++ sysutils/amanda-common/Makefile.common 11 Dec 2006 02:27:27 -0000
@@ -44,3 +44,4 @@
CONFIGURE_ARGS+= --with-gnutar-listdir=${AMANDA_VAR}/gnutar-lists
CONFIGURE_ARGS+= --with-dump-honor-nodump
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
+CONFIGURE_ARGS+= --with-maxtapeblocksize=64
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->gdt
Responsible-Changed-By: gdt@netbsd.org
Responsible-Changed-When: Mon, 11 Dec 2006 13:18:52 +0000
Responsible-Changed-Why:
gdt will send first part upstream and look at second aprt
State-Changed-From-To: open->feedback
State-Changed-By: gdt@netbsd.org
State-Changed-When: Wed, 07 Feb 2007 02:08:15 +0000
State-Changed-Why:
Issue #1 addressed.
Issue #2: discussion about why I don't favor the suggested fix added.
From: Greg Troxel <gdt@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35231 CVS commit: pkgsrc/sysutils/amanda-server
Date: Wed, 7 Feb 2007 02:04:15 +0000 (UTC)
Module Name: pkgsrc
Committed By: gdt
Date: Wed Feb 7 02:04:15 UTC 2007
Modified Files:
pkgsrc/sysutils/amanda-server: Makefile distinfo
Added Files:
pkgsrc/sysutils/amanda-server/patches: patch-ap
Log Message:
add patch:
Make chg-chio wait for a tape to come ready after loading it.
clean up $MT/@MT@ confusion in chg-chio
Patch from Aaron Grier in PR pkg/35231.
(This resolves issue #1 in the PR; issue #2 is unrelated.)
To generate a diff of this commit:
cvs rdiff -r1.39 -r1.40 pkgsrc/sysutils/amanda-server/Makefile
cvs rdiff -r1.10 -r1.11 pkgsrc/sysutils/amanda-server/distinfo
cvs rdiff -r0 -r1.1 pkgsrc/sysutils/amanda-server/patches/patch-ap
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Aaron J. Grier" <agrier@poofygoof.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/35231 (sysutils/amanda-server: poor changer support / short reads)
Date: Tue, 6 Feb 2007 21:16:39 -0800
the clencher is that amanda labels are 32kB, and the routines to read
them do not set the block size to 32kB before attempting the read. I
recorded that I was going to try -o, but no note of the results. when I
get some more new DLTs in, I'll try it out again.
throughput testing indicated that there was no penalty for using 32kB
blocks, so I gave in and moved on to more changer issues.
the immediate issue was fixed with the included patch and using 32kB
blocks.
State-Changed-From-To: feedback->closed
State-Changed-By: gdt@netbsd.org
State-Changed-When: Thu, 08 Feb 2007 13:33:19 +0000
State-Changed-Why:
Submitter agreed PR can be closed. The issue about amtapetype and
blocksize remains, but we agreed that it should be fixed upstream.
>Unformatted:
I have committed the patch for issue #1. (Note that I can't test it.)
I will send it upstream.
For Issue #2, the suggested fix has other consequences, and doesn't
really address the problem (fixes for 64, not for 128, etc.). Can you
try the '-o' option to amtapetype, which is documented to "overwrite
the tape even if it's an amanda tape"? Arguably amtapetype should
inherit amrestore's tapeblocksize-divining logic.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.