From nobody@FreeBSD.org  Mon Jan 12 22:13:45 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 089471065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jan 2009 22:13:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id EC8E28FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jan 2009 22:13:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CMDiA8036614
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jan 2009 22:13:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n0CMDibE036611;
	Mon, 12 Jan 2009 22:13:44 GMT
	(envelope-from nobody)
Message-Id: <200901122213.n0CMDibE036611@www.freebsd.org>
Date: Mon, 12 Jan 2009 22:13:44 GMT
From: John Levine <johnl@iecc.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: restore doesn't recognize out of space on /tmp
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130477
>Category:       bin
>Synopsis:       restore(8) doesn't recognize out of space on /tmp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 12 22:20:00 UTC 2009
>Closed-Date:    Sun Mar 22 02:55:52 UTC 2009
>Last-Modified:  Sun Mar 22 02:55:52 UTC 2009
>Originator:     John Levine
>Release:        7.0
>Organization:
>Environment:
Booted from live FS i386 CD
>Description:
I booted from CD and was restoring filesystems from dumps on a USB disk onto a fresh system disk.  When I tried to restore /var from about a 800MB dump, I got all sorts of strange errors even though the dump was known to be good. After poking around I realized that the problem was there was very little room on /tmp and it filled up. I mounted a reasonable /tmp partition and it worked fine.

Restore of the much larger /usr dump failed immediately, so it appears that some writes to the tmp files check for failure, but some don't.
>How-To-Repeat:
Try to restore a medium sized dump (800MB in my case) on a system with a tiny little /tmp

>Fix:
A quick look at the source code notes several fwrite() calls in dirs.c that don't check the return value.


>Release-Note:
>Audit-Trail:

From: Yoshihiro Ota <ota@j.email.ne.jp>
To: bug-followup@FreeBSD.org, johnl@iecc.com
Cc:  
Subject: Re: bin/130477: restore(8) doesn't recognize out of space on /tmp
Date: Thu, 15 Jan 2009 03:47:00 -0500

 It was fixed after 7.0-RELEASE.
 
 http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/restore/dirs.c?r1=1.34#rev1.34
 
 /tmp: write failed, filesystem is full
 restore: /tmp/rstdir1232008271: cannot write directory database: No space left on device
 Try making space in /tmp, or set environment variable TMPDIR
 to an alternate location with more disk space.
 
 Hiro

From: John L <johnl@iecc.com>
To: Yoshihiro Ota <ota@j.email.ne.jp>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/130477: restore(8) doesn't recognize out of space on /tmp
Date: Thu, 15 Jan 2009 11:21:58 +0000 (GMT)

 You're right, I agree that the current code appears to catch all of the 
 write failures.
 
 > It was fixed after 7.0-RELEASE.
 >
 > http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/restore/dirs.c?r1=1.34#rev1.34
 >
 > /tmp: write failed, filesystem is full
 > restore: /tmp/rstdir1232008271: cannot write directory database: No space left on device
 > Try making space in /tmp, or set environment variable TMPDIR
 > to an alternate location with more disk space.
 >
 > Hiro
 >
 >
 
 Regards,
 John Levine, johnl@iecc.com, Primary Perpetrator of "The Internet for Dummies",
 Information Superhighwayman wanna-be, http://www.johnlevine.com, ex-Mayor
 "More Wiener schnitzel, please", said Tom, revealingly.
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Mar 22 02:55:29 UTC 2009 
State-Changed-Why:  
Apparently fixed after 7.0-RELEASE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130477 
>Unformatted:
