From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7522 invoked from network); 22 Jul 1997 17:45:37 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 22 Jul 1997 17:45:37 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA07245; Tue, 22 Jul 1997 13:33:14 -0400 (EDT) Resent-Date: Tue, 22 Jul 1997 13:33:14 -0400 (EDT) From: (Zoltan T. Hidvegi) Message-Id: <9707221724.AA16270@belgium.fishkill.ibm.com> Subject: Re: 3.1.2 beta bug In-Reply-To: <199707220835.JAA20961@taos.demon.co.uk> from Andrew Main at "Jul 22, 97 09:35:05 am" To: zefram@tao.co.uk (Andrew Main) Date: Tue, 22 Jul 1997 13:24:30 -0400 (EDT) Cc: zsh-workers@math.gatech.edu (Zsh workers list) X-Mailer: ELM [version 2.4ME+ PL31H (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"-2x8-3.0.5n1.PxErp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3372 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Andrew Main wrote: > > Maybe a test for nlink == 2 instead of <= 2 > >would help. A filesystem without the usual Unix directory link count > >semantics would probably have link count 1 for directories. > > No, not really. Under Linux: > > % ls -ld /proc /proc/*(/) > dr-xr-xr-x 5 root root 0 Apr 30 22:29 /proc [...] > The link count of 5 on /proc suggests three subdirectories, whereas it > actually has many more. Even if zsh isn't doing that form of leaf > optimisation, the fact remains that a directory can easily have a > meaningful but wrong link count. Not to mention the possibility of > a directory actually having multiple links other than . and .. (more > useful than one might imagine). Zsh only uses a vesimple leaf optimization. The only assumption it makes (after my last patch) is that a directory with link count 2 has no subdirectories. It does not assume that a directory with more than 2 links has any subdirectories or has at most nlink-2 subdirs. And that assumption is corrent in almost all cases. I know of no filesystem on Linux where this assumption fails. The msdos filesystem for example corretly emulates the Unix semantics. But certainly there should be a configure option for this. The question is the default state of this option. It can even be a runtime option, as really the extra code is just one test. And with that run-time option enabled we may even do full leaf optimization. The reporter of the original problem from SGI still haven't answered, I'd like to know if this assumption holds for this funny SGI filesystem. Zoltan