9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ethan Grammatikidis <eekee57@fastmail.fm>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Tvx update
Date: Fri, 28 May 2010 17:53:36 +0100	[thread overview]
Message-ID: <F98A541B-9DDE-44F3-964B-173E75D403FE@fastmail.fm> (raw)
In-Reply-To: <20100528160457.D654B5B87@mail.bitblocks.com>


On 28 May 2010, at 17:04, Bakul Shah wrote:

> On Fri, 28 May 2010 12:51:36 BST Ethan Grammatikidis <eekee57@fastmail.fm
> >  wrote:
>>
>> On 27 May 2010, at 21:16, Bakul Shah wrote:
>>
>>> If BSD had
>>> implemented ".." correctly (i.e. walk back up one level in
>>> the given path), symlinks would have been more useful and
>>> less surprising.
>>
>> This "correct" implementation of symlinks has never seemed right to
>> me. Linux / Bash used to do it the "wrong" way as recently as 2001 if
>> not more recently. I was much more comfortable with the "wrong" way,
>> with symlinks just being a portal to another place entirely, and I
>> wish I could pinpoint why. Having the path "faked" after following a
>> symlink just feels badly wrong, and I wish I could put a semantic
>> reason on it.
>
> The kernel needs to implement this, not any user program.
> When a single user program implements this and no others, it
> is far more confusing!

Indeed! In at least one of my early Linux installs (early to me, not
Linux 0.x) bash implemented this  but nothing else did, which is
probably the basis for my dislike of it, to be honest.

>
> By correct I meant maintaining the following:
>
>    <prefix>/<component>/..[/<suffix>] == <prefix>[/<suffix>]
>    /..[<suffix>] == /[<suffix>]
>
> where <component> is not a literal ".." but can be any other
> directory name or a symlink to anything (including "..").
> This path string simplification is done left to right. Thus:
>
> 	a/b/c/../../d == a/b/../d == a/d
>
> The kernel needs to keep the full path to $PWD in order to
> perform this simplification with relative paths.  In effect
> the kernel needs to strip out all .. from a given path before
> interpreting it.  And of course the kernel must check that
> <component> names an existent directory.
>
> Given these changes symlinks will behave in an unsurprising
> way.  Consider:
>
> One user:
> cd /tmp
> mkdir -p a/b/c
> ln -s a/b/c x
>
> # Some other user at some other time:
> cd /tmp/d
> cd ..
> /bin/pwd	# this should show /tmp. At present it shows /tmp/a/b
> ln -s d/../a e
> cd e		# this should succeed. At present it fails.
> ln -s d/../../b f
> cd f		# if there is no /b this should fail. At present it succeeds.
>
> In a later email you said "Maybe the fact that no-one seems
> to like to keep the pwd in the kernel is argument enough".  A
> lack of popularity is not reason enough to reject this; one
> must find/understand any technical reasons.

Aye, I'm trying to save myself some time in gaining an understanding,
but perhaps that's not such a good idea.

> The days of
> having to fit a kernel in 64KB are long gone (which could've
> been a pragmatic reason once). I can't see a logical argument
> as to why the kernel shouldn't keep the full path.  [Of
> course, there may be one, but so far I have not seen it]
>
> The only thing that can't be fixed is if the symlink target
> disappears. This is the same as when (remote) target of your
> bind (or mount) disappears.
>

Thanks for writing all this, & that goes for everyone involved the
discussion. I read and think about a lot more than I reply to, & often
save posts when I don't understand something immediately.

--
Simplicity does not precede complexity, but follows it. -- Alan Perlis




  parent reply	other threads:[~2010-05-28 16:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 18:46 EBo
2010-05-25 19:34 ` Nick LaForge
2010-05-25 19:57   ` EBo
2010-05-26 18:02     ` Nick LaForge
2010-05-26 18:17       ` erik quanstrom
2010-05-26 20:35         ` EBo
2010-05-26 20:42       ` EBo
2010-05-26 23:31         ` Nick LaForge
2010-05-26 23:53         ` erik quanstrom
2010-05-26 23:58       ` ron minnich
2010-05-27  1:50         ` Nick LaForge
2010-05-27  2:51           ` ron minnich
2010-05-27  4:19             ` EBo
2010-05-27  5:03               ` Nick LaForge
2010-05-27  5:18                 ` EBo
2010-05-27  7:17                 ` EBo
2010-05-27 14:30                   ` hiro
2010-05-27 18:14                     ` Jorden M
2010-05-27 19:26                     ` EBo
2010-05-28  3:42                       ` ron minnich
2010-05-27  5:48               ` ron minnich
2010-05-27  7:02                 ` EBo
2010-05-27 14:39                   ` ron minnich
     [not found]                 ` <5147DCD3-BD95-4D54-96B7-30DCA4D113DA@mit.edu>
2010-05-27 19:59                   ` Chad Brown
2010-05-27 20:16                     ` Bakul Shah
2010-05-28  3:41                       ` ron minnich
2010-05-28 10:34                         ` erik quanstrom
2010-05-28 11:04                           ` Ethan Grammatikidis
2010-05-28 11:51                       ` Ethan Grammatikidis
2010-05-28 11:59                         ` erik quanstrom
2010-05-28 12:19                           ` Ethan Grammatikidis
2010-05-28 13:20                             ` erik quanstrom
2010-05-28 15:09                               ` Steve Simon
2010-05-28 16:21                                 ` Ethan Grammatikidis
2010-05-28 16:26                                   ` erik quanstrom
2010-05-28 16:38                                     ` Ethan Grammatikidis
2010-05-28 16:04                         ` Bakul Shah
2010-05-28 16:13                           ` erik quanstrom
2010-05-28 16:53                           ` Ethan Grammatikidis [this message]
2010-05-27 20:20                     ` EBo
2010-05-27  4:54         ` EBo
2010-05-27  6:57           ` ron minnich
2010-05-27  7:07             ` EBo
2010-05-27 14:38               ` ron minnich
2010-05-27 19:11                 ` EBo
2010-05-28  3:44                   ` ron minnich
2010-05-28 10:24                     ` erik quanstrom
2010-06-13  8:43 [9fans] tvx update EBo
2010-08-19  2:39 ` Ryousei Takano
2010-08-19  3:02   ` EBo

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=F98A541B-9DDE-44F3-964B-173E75D403FE@fastmail.fm \
    --to=eekee57@fastmail.fm \
    --cc=9fans@9fans.net \
    /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.
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).