Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 98 18:28:53 +0000 (GMT)
From:      dwmalone@maths.tcd.ie
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/5704: restore coredumps on filesystems with small blocksizes
Message-ID:  <9802101828.aa06956@synge.maths.tcd.ie>

next in thread | raw e-mail | index | archive | help

>Number:         5704
>Category:       bin
>Synopsis:       restore coredumps on filesystems with small blocksizes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 10 10:30:00 PST 1998
>Last-Modified:
>Originator:     David Malone
>Organization:
School of Mathematics, Trinity College Dublin, Ireland.
>Release:        FreeBSD 2.2.5-STABLE i386
>Environment:

	If you run restore with cwd on an nfs3 filesystem (say)
	where the blocksize is less than 1024, restore will give
	a bus error.

>Description:

	The logic in tape.c:getfile() doesn't allow for a filesystem
	with a blocksize smaller than the tape block size. The problem
	seems to be most easily fixed by changeing where fssize is set. 

>How-To-Repeat:

	cd /nfs3 
	cat dump | restore ivbf 2 - 

>Fix:
	
	This diff changes the setting of fssize, so that if the filesystem
	blocksize is too small it is set to the minimum (TP_BSIZE), otherwise
	the logic is as before.


--- /usr/src/sbin/restore/tape.c	Thu Jan 29 22:26:11 1998
+++ tape.c	Tue Feb 10 18:17:31 1998
@@ -231,7 +231,9 @@
 		fprintf(stderr, "cannot stat .: %s\n", strerror(errno));
 		done(1);
 	}
-	if (stbuf.st_blksize > 0 && stbuf.st_blksize <= MAXBSIZE)
+	if (stbuf.st_blksize > 0 && stbuf.st_blksize < TP_BSIZE )
+		fssize = TP_BSIZE;
+	if (stbuf.st_blksize >= TP_BSIZE && stbuf.st_blksize <= MAXBSIZE)
 		fssize = stbuf.st_blksize;
 	if (((fssize - 1) & fssize) != 0) {
 		fprintf(stderr, "bad block size %d\n", fssize);

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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