From scratchy@Incore.DE  Tue Nov  4 01:22:28 2003
Return-Path: <scratchy@Incore.DE>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B274C16A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Nov 2003 01:22:28 -0800 (PST)
Received: from dss.incore.de (dss.incore.de [195.145.1.138])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CA25643F85
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Nov 2003 01:22:26 -0800 (PST)
	(envelope-from scratchy@Incore.DE)
Received: from imap.incore (imap [192.168.0.64])
	by dss.incore.de (8.11.6/8.9.3) with ESMTP id hA49MY504269
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 4 Nov 2003 10:22:34 +0100
Received: from uxpae.incore (uxpae.incore [192.168.0.69])
	by imap.incore (Postfix on SuSE eMail Server 2.0) with ESMTP
	id 1A2F9639B7; Tue,  4 Nov 2003 10:22:34 +0100 (CET)
Received: from uxpae.incore (localhost [127.0.0.1])
	by uxpae.incore (8.12.9/8.12.9) with ESMTP id hA49MOd4001183;
	Tue, 4 Nov 2003 10:22:24 +0100 (CET)
	(envelope-from scratchy@uxpae.incore)
Received: (from scratchy@localhost)
	by uxpae.incore (8.12.9/8.12.9/Submit) id hA49MOil001182;
	Tue, 4 Nov 2003 10:22:24 +0100 (CET)
	(envelope-from scratchy)
Message-Id: <200311040922.hA49MOil001182@uxpae.incore>
Date: Tue, 4 Nov 2003 10:22:24 +0100 (CET)
From: vpaepcke@dssgmbh.de
Reply-To: vpaepcke@dssgmbh.de
To: FreeBSD-gnats-submit@freebsd.org
Cc: vpaepcke@Incore.DE
Subject: dump fails on big directories with nodump flag set
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58912
>Category:       bin
>Synopsis:       dump fails on big directories with nodump flag set
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 04 01:30:18 PST 2003
>Closed-Date:    Sun Jan 11 16:33:39 PST 2004
>Last-Modified:  Sun Jan 11 16:33:39 PST 2004
>Originator:     Volker Paepcke <vpaepcke@incore.de>
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
DSS Incore-Service GmbH - http//www.incore.de
>Environment:
System: FreeBSD uxpae.incore 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #2: Sat Sep 6 13:17:54 CEST 2003 root@uxpae.incore:/ad0/opt/obj/usr/src/sys/UXPAE i386

	All stable and current versions are affected by this error!
>Description:
	Dump doesn't propagate the nodump flag on big directories
	correctly. Only the entries contained in the first block
	are propagated. All further entries are simply skipped
	and may be dumped despite the nodump flag.
>How-To-Repeat:
	Create a directory with a size bigger than one block.
	Set the nodump flag on this directory and backup the
	filesystem containing this directory.
>Fix:
	There is a bug in /usr/src/sbin/dump/traverse.c:
	The inode buffer referenced by dp may change during the
	the call to searchdir() and may not be used thereafter.
	The inode buffer di containing a copy of the original one 
	must be used instead.

*** /usr/src/sbin/dump/traverse.c.1st   Sat Aug 30 12:33:03 2003
--- /usr/src/sbin/dump/traverse.c       Tue Nov  4 09:46:43 2003
***************
*** 232,238 ****
                for (ret = 0, i = 0; filesize > 0 && i < NDADDR; i++) {
                        if (di.di_db[i] != 0)
                                ret |= searchdir(ino, di.di_db[i],
!                                       (long)dblksize(sblock, dp, i),
                                        filesize, tapesize, nodump);
                        if (ret & HASDUMPEDFILE)
                                filesize = 0;
--- 232,238 ----
                for (ret = 0, i = 0; filesize > 0 && i < NDADDR; i++) {
                        if (di.di_db[i] != 0)
                                ret |= searchdir(ino, di.di_db[i],
!                                       (long)dblksize(sblock, &di, i),
                                        filesize, tapesize, nodump);
                        if (ret & HASDUMPEDFILE)
                                filesize = 0;
>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: vpaepcke@dssgmbh.de
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/58912: dump fails on big directories with nodump flag set 
Date: Tue, 04 Nov 2003 12:49:48 +0000

 In message <200311040922.hA49MOil001182@uxpae.incore>, vpaepcke@dssgmbh.de writ
 es:
 >>Fix:
 >	There is a bug in /usr/src/sbin/dump/traverse.c:
 >	The inode buffer referenced by dp may change during the
 >	the call to searchdir() and may not be used thereafter.
 >	The inode buffer di containing a copy of the original one 
 >	must be used instead.
 
 Thanks for tracking this down! BTW, there seems to be another use
 of `dp' a few lines later that suffers from the same problem. I'll
 fix both shortly.
 
 Ian
State-Changed-From-To: open->patched 
State-Changed-By: iedowse 
State-Changed-When: Tue Nov 4 06:20:53 PST 2003 
State-Changed-Why:  

Committed as revision 1.33 of traverse.c, thanks! Awaiting MFC to 
RELENG_4. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58912 
State-Changed-From-To: patched->closed 
State-Changed-By: iedowse 
State-Changed-When: Sun Jan 11 16:32:23 PST 2004 
State-Changed-Why:  

Fixed in -STABLE now too. Sorry for the delay. 

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