From owner-cvs-src@FreeBSD.ORG Thu Jan 13 07:22:05 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E540216A4CE; Thu, 13 Jan 2005 07:22:05 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B91B43D1F; Thu, 13 Jan 2005 07:22:05 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.13.1) with ESMTP id j0D7LrSw028593; Thu, 13 Jan 2005 02:21:53 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.13.1/Submit) id j0D7Lrbd028592; Thu, 13 Jan 2005 02:21:53 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 13 Jan 2005 02:21:53 -0500 From: David Schultz To: Tim Kientzle Message-ID: <20050113072153.GA28485@VARK.MIT.EDU> Mail-Followup-To: Tim Kientzle , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200501120735.j0C7ZABq048856@repoman.freebsd.org> <41E5ED66.4070902@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E5ED66.4070902@freebsd.org> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: Pawel Jakub Dawidek cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/include fts.h src/lib/libc/gen fts.3 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2005 07:22:06 -0000 On Wed, Jan 12, 2005, Tim Kientzle wrote: > Pawel Jakub Dawidek wrote: > >pjd 2005-01-12 07:35:09 UTC > > > > FreeBSD src repository > > > > Modified files: (Branch: RELENG_5) > > include fts.h > > lib/libc/gen fts.3 > > Log: > > MFC: fts.h 1.11 > > fts.3 1.22 > > > > Introduce new field 'fts_bignum' which is 64bit long and will allow to > > make utilities like du(1) 64bit-clean. > > When this field is used, one cannot use 'fts_number' and 'fts_pointer' > > fields. > > > > This commit doesn't break API nor ABI. > > > > This work is part of the BigDisk project: > > > > http://www.FreeBSD.org/projects/bigdisk/ > > Any plans to deal with other fts limits, > such as the inability to perform a logical > traversal of a path longer than PATH_MAX or > to reduce memory consumption when dealing > with very large directory trees? Removing FTS_LOGICAL's path length limitation is nontrivial, but given your experience with bsdtar, I'd say you're an ideal person to do it. ;-) AFAIK, the problem is that fts() effectively uses chdir("..") to climb up one level in the tree in chdir mode. If it chdir'd across a symlink earlier, this would put it in the wrong place. Perhaps you have a better solution, but my best idea is to keep the parent directory open when chdiring across a symlink, making it possible to fchdir() back to the parent. Additional complications are needed to decide, at each step, whether to ascend using the stack of parent references or using chdir(".."). A more uniform approach would be to keep all the "ancestor" directories open during the traversal, i.e., always keep the parent open when descending a level. Unfortunately, this limits the traversal depth to the number of available file descriptors. (On the other hand, I would argue that anyone with a directory tree a few thousand levels deep is asking for trouble.)