9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] bind, ns weirdness
Date: Thu,  6 Mar 2003 16:18:20 -0500	[thread overview]
Message-ID: <885058543eea2b91cb1e88db79969625@plan9.bell-labs.com> (raw)
In-Reply-To: <20030306235259.27037.qmail@mail.dirac.net>

ns is not manipulating the data.
it is showing you the internal
kernel data structures.  the kernel
doesn't keep the history of every
mount, bind, unmount, and in fact
the kernel doesn't keep the structure
as a list.  it keeps it as a hash table
for quick access, and the mount points
are represented by chans (think vnodes)
rather than actual path strings.  
when you look at just the strings
(as happens when it is presented in
the ns file) there is no guarantee that
the names are still valid.

as you point out the fundamental
problem here is that unmount removes
things from the hash table (and thus from
the list presented in /proc/$pid/ns),
things that other binds or mounts might
have depended on to make sense of the
names at the time.

it is entirely reasonable that unmount
removes things from the hash table:
they're gone!  then the chans can be
closed, and the resources reused.
in order to keep the entries in /proc/$pid/ns
around, the chans would have to be
kept open, which is against the point 
of unmount.  unmount means release
this binding, not make it invisible but
hold onto the resources.

perhaps some stub should remain in
the in-order list that has an empty 
chan structure with just a name,
so that the ns list is correct.  perhaps.



  reply	other threads:[~2003-03-06 21:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06 23:52 Keith Nash
2003-03-06 21:18 ` Russ Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-07  1:32 Joel Salomon
2003-03-06 22:51 ` Russ Cox
2003-03-06 21:58 Keith Nash
2003-03-06 22:16 ` David Presotto

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=885058543eea2b91cb1e88db79969625@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.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;
as well as URLs for NNTP newsgroup(s).