zsh-workers
 help / color / mirror / code / Atom feed
From: <hzoli@VNET.IBM.COM> (Zoltan T. Hidvegi)
To: zefram@tao.co.uk (Andrew Main)
Cc: zsh-workers@math.gatech.edu (Zsh workers list)
Subject: Re: 3.1.2 beta bug
Date: Tue, 22 Jul 1997 13:24:30 -0400 (EDT)	[thread overview]
Message-ID: <9707221724.AA16270@belgium.fishkill.ibm.com> (raw)
In-Reply-To: <199707220835.JAA20961@taos.demon.co.uk> from Andrew Main at "Jul 22, 97 09:35:05 am"

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


      parent reply	other threads:[~1997-07-22 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-21 19:25 Jesse Zbikowski
1997-07-21 19:51 ` Zoltan Hidvegi
1997-07-22  8:35   ` Andrew Main
1997-07-22 11:12     ` Geoff Wing
1997-07-22 17:24     ` Zoltan T. Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9707221724.AA16270@belgium.fishkill.ibm.com \
    --to=hzoli@vnet.ibm.com \
    --cc=zefram@tao.co.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).