From owner-freebsd-stable@FreeBSD.ORG Wed Apr 8 15:13:47 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2E061065672 for ; Wed, 8 Apr 2009 15:13:47 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id A80598FC18 for ; Wed, 8 Apr 2009 15:13:47 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id n38EkR6j057166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 8 Apr 2009 09:46:28 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id n38EkRCR096185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 8 Apr 2009 09:46:27 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id n38EkP56096177; Wed, 8 Apr 2009 09:46:25 -0500 (CDT) (envelope-from dan) Date: Wed, 8 Apr 2009 09:46:25 -0500 From: Dan Nelson To: Lars Eggert Message-ID: <20090408144625.GA90152@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 7.1-STABLE User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: ClamAV version 0.94.1, clamav-milter version 0.94.1 on email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Wed, 08 Apr 2009 09:46:28 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: stable@freebsd.org Subject: Re: bdes: fwrite error at 8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 15:13:48 -0000 In the last episode (Apr 08), Lars Eggert said: > I'm doing encrypted nightly dumps over the network to an NFS file system, > i.e., dump | bzip2 | bdes > nfs. > > Since about a week ago, I see occasional errors from bdes ("bdes: > fwrite error at 8"). Anyone have a hunch what's going on here? I'm > wondering if this is something that started when I upgraded to 7.2- > PRERELEASE... [..] > DUMP: 34.16% done, finished in 0:48 at Wed Apr 8 04:46:41 2009 > bdes: fwrite error at 8 > DUMP: 38.56% done, finished in 0:47 at Wed Apr 8 04:51:17 2009 Two bugs: if fwrite fails, there's no sense in continuing to encrypt, and it should print the error it got. Apply this patch and try again: Index: bdes.c =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/bdes/bdes.c,v retrieving revision 1.9 diff -u -r1.9 bdes.c --- bdes.c 10 Feb 2005 14:47:06 -0000 1.9 +++ bdes.c 8 Apr 2009 14:32:43 -0000 @@ -112,7 +112,7 @@ #define READ(buf, n) fread(buf, sizeof(char), n, stdin) #define WRITE(buf,n) \ if (fwrite(buf, sizeof(char), n, stdout) != n) \ - warnx("fwrite error at %d", n); + err(1, "fwrite error at %d", n); /* * global variables and related macros After patching, the following test commands should print a single usefull error instead of a stream of useless ones. $ trap '' PIPE $ bdes -k asd < /boot/kernel/kernel | dd of=/dev/null count=1 -- Dan Nelson dnelson@allantgroup.com