public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: Alexander Viro <viro@math.psu.edu>
Cc: Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org
Subject: Re: symlink_prefix
Date: Thu, 07 Jun 2001 05:43:42 +0200	[thread overview]
Message-ID: <3B1EF86E.9EDE50A7@gmx.de> (raw)
In-Reply-To: <Pine.GSO.4.21.0106062112340.10233-100000@weyl.math.psu.edu>

Alexander Viro wrote:
> 
> On Thu, 7 Jun 2001, Edgar Toernig wrote:
> 
> > Alexander Viro wrote:
> > >         ...
> > >         dir = open("/usr/local", O_DIRECTORY);
> > >         /* error handling */
> > >         new_mount(dir, MNT_SET, fs_fd); /* closes dir and fs_fd */
> >
> > Do you really want to start using fds instead of strings for tree
> > modifying commands (link, unlink, symlink, rename, mount and umount)?
> > Even if it were possible in the new_mount case it wouldn't have the
> > atomic lookup+act nature of the old mount.  And then, _I_ would
> > prefer a uniform interface for tree management commands - strings.
> 
> You have exactly the same atomicity warranties. That is to say, none.
> Mountpoint can be renamed between the lookup and mounting.

Ok.  I thought, mounting is an atomic operation (though normally not
required).  Hmm... but looking at your last batch of VFS patches sent
to lkml you consider mount a more used call in the future ;-)  Maybe
it would be better to have some more strict rules for mount if ie each
login performs a dozen of them...

> Moreover, even after mount(2) you can rename() parent of mountpoint. On
> all Unices I've seen (well, aside of v7 which didn't have rename(2)).
> So if you rely on anything of that kind - you are screwed. Portably
> screwed, at that.

I thought more about a rename of ie "/usr/local" between the open and
the new_mount call.  I guess, an unlink("/usr/local") after the open
will let the new_mount fail.  Btw, what happens in this case of two
concurrent mounts?

	fd1=open("/foo")
	fd2=open("/foo")
	new_mount(fd1...)
	new_mount(fd2...)	// or vice versa, first fd2 then fd1

>[...] but even if your argument makes sense, it only makes sense for
> "dir" argument. "device" is nothing but a filesystem-specific option.

Sure.  I only meant the "dir" argument.

Maybe I've just an uneasy feeling about such a change because it exposes
and depends on internal implementation details of the kernel (the dcache).
On other systems it's normally not possible to associate a unique name
with a file descriptor.  Newer Linux versions may support this for
directories due to the dcache (not sure if this is really always the case).
And this calling convention for new_mount would be the first one that
makes this visible in userspace.  And it would depend on this feature.
This may limit future changes of the kernel VFS implementation (maybe
someone really adds some kind of hardlinked directories or something
else that makes it impossible to get a unique name for a dir fd).

Ciao, ET.

  reply	other threads:[~2001-06-07  3:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-03 10:53 symlink_prefix Andries.Brouwer
2001-06-03 11:25 ` symlink_prefix Alexander Viro
2001-06-04 11:53   ` symlink_prefix Remi Turk
2001-06-05 12:43   ` symlink_prefix Pavel Machek
2001-06-07  1:00   ` symlink_prefix Edgar Toernig
2001-06-07  1:19     ` symlink_prefix Alexander Viro
2001-06-07  3:43       ` Edgar Toernig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-06-04 12:28 symlink_prefix Hank Leininger
2001-06-05  2:31 ` symlink_prefix Ton Hospel
2001-06-03 17:37 symlink_prefix Andries.Brouwer
2001-06-03 16:36 symlink_prefix Andries.Brouwer
2001-06-03 17:19 ` symlink_prefix Alexander Viro
2001-06-04 22:05   ` symlink_prefix Albert D. Cahalan
2001-06-03 15:10 symlink_prefix Andries.Brouwer
2001-06-03 15:27 ` symlink_prefix Alexander Viro
2001-06-02 23:54 symlink_prefix Andries.Brouwer
2001-06-03  0:23 ` symlink_prefix Robert Love
2001-06-03  0:49 ` symlink_prefix Alexander Viro
2001-06-03  1:00   ` symlink_prefix Mitchell Blank Jr

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=3B1EF86E.9EDE50A7@gmx.de \
    --to=froese@gmx.de \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox