Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2008 19:30:10 GMT
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/121502: option -P appears to be broken in restore(8) since FreeBSD 6.3 (regression)
Message-ID:  <200803301930.m2UJUAWm088332@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/121502; it has been noted by GNATS.

From: Jaakko Heinonen <jh@saunalahti.fi>
To: Derek =?utf-8?B?S3VsacWEc2tp?= <takeda@takeda.tk>
Cc: bug-followup@FreeBSD.org, green@FreeBSD.org
Subject: Re: bin/121502: option -P appears to be broken in restore(8) since
	FreeBSD 6.3 (regression)
Date: Sun, 30 Mar 2008 22:28:55 +0300

 --huq684BweRXVnRxX
 Content-Type: text/plain; charset=utf-8
 Content-Disposition: inline
 Content-Transfer-Encoding: 8bit
 
 
 Hi,
 
 On 2008-03-23, Derek Kuliński wrote:
 > Now I tried to your suggestion and it seems to work as it supposed to
 > with the gzip from ports. Well.. I see the "Header with wrong
 > dumpdate." but other than that it works fine.
 
 This is a separate bug. See the PR bin/118087
 (http://www.freebsd.org/cgi/query-pr.cgi?pr=118087).
 
 On 2008-03-24, Derek Kuliński wrote:
 > One more thing, before patching, there's a different behavior:
 
 Here's a patch that keeps the behavior same. The patch just enables the
 short read code in readtape() (tape.c) when -P is used. There's still
 obviously wrong code related to -P option in getvol(). I have marked it
 with XXX comment.
 
 -- 
 Jaakko
 
 --huq684BweRXVnRxX
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="restore-pipecmdin.diff"
 
 Index: tape.c
 ===================================================================
 RCS file: /home/ncvs/src/sbin/restore/tape.c,v
 retrieving revision 1.49
 diff -p -u -r1.49 tape.c
 --- tape.c	6 Mar 2007 08:13:20 -0000	1.49
 +++ tape.c	30 Mar 2008 17:17:11 -0000
 @@ -333,6 +333,12 @@ getvol(long nextvol)
  		}
  		if (volno == 1)
  			return;
 +		/*
 +		 * XXX: Following if branch is never reached because pipein
 +		 * XXX: and pipecmdin are never set at the same time.
 +		 * XXX: Secondly the goto to getpipecmdhdr can't be correct
 +		 * XXX: because it skips the code where newvol is initialized.
 +		 */
  		if (pipecmdin) {
  			closemt();
  			goto getpipecmdhdr;
 @@ -1202,17 +1208,17 @@ getmore:
  	 * Check for mid-tape short read error.
  	 * If found, skip rest of buffer and start with the next.
  	 */
 -	if (!pipein && numtrec < ntrec && i > 0) {
 +	if ((!pipein && !pipecmdin) && numtrec < ntrec && i > 0) {
  		dprintf(stdout, "mid-media short read error.\n");
  		numtrec = ntrec;
  	}
  	/*
  	 * Handle partial block read.
  	 */
 -	if (pipein && i == 0 && rd > 0)
 +	if ((pipein || pipecmdin) && i == 0 && rd > 0)
  		i = rd;
  	else if (i > 0 && i != ntrec * TP_BSIZE) {
 -		if (pipein) {
 +		if (pipein || pipecmdin) {
  			rd += i;
  			cnt -= i;
  			if (cnt > 0)
 
 --huq684BweRXVnRxX--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803301930.m2UJUAWm088332>