Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #208361

Re: A Basic Mount Observation

From <tomas@tuxteam.de>
Newsgroups linux.debian.user
Subject Re: A Basic Mount Observation
Date 2019-05-07 17:40 +0200
Message-ID <xVamd-5il-5@gated-at.bofh.it> (permalink)
References <xV9Jw-4Pt-3@gated-at.bofh.it> <xVacx-5fa-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, May 07, 2019 at 11:20:57AM -0400, Dan Ritter wrote:
> Martin McCormick wrote: 
> > 	I may just be remembering things the wrong way [...]

[about not immediatlely "seeing" the results of a mount on the CWD]

[...]

> mkdir point
> cd point
> touch original
> ls

[practical demonstration illustrating that]

> This behavior has always been consistent in Linux, as far as I am aware.
> 
> The handle to your current directory cannot be changed out from
> underneath you; only when you move away from it can it be
> released, and from then on you see the new mount.

Makes sense: the current shell (and that is from where we're looking
at things) keeps the current working directory, CWD, open. This inode
doesn't go away after a mount -- thus as long as the shell doesn't
close it (by, e.g., changing to another directory), it will keep
"seeing" that directory, even if a new process doing an open() will
"see" the result after the mount.

You can achieve similarly funny results by removing a file (or directory)
while it's kept open by a process.

Cheers
-- tomás

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A Basic Mount Observation "Martin McCormick" <martin.m@suddenlink.net> - 2019-05-07 17:00 +0200
  Re: A Basic Mount Observation Dan Ritter <dsr@randomstring.org> - 2019-05-07 17:30 +0200
    Re: A Basic Mount Observation <tomas@tuxteam.de> - 2019-05-07 17:40 +0200
      Re: A Basic Mount Observation Cindy Sue Causey <butterflybytes@gmail.com> - 2019-05-07 18:10 +0200
        Re: A Basic Mount Observation Dan Ritter <dsr@randomstring.org> - 2019-05-07 18:30 +0200
  Re: A Basic Mount Observation Cindy Sue Causey <butterflybytes@gmail.com> - 2019-05-07 18:10 +0200
    Re: A Basic Mount Observation Bob Weber <bobrweber@gmail.com> - 2019-05-07 19:00 +0200
    Re: A Basic Mount Observation "Thomas Schmitt" <scdbackup@gmx.net> - 2019-05-07 19:00 +0200

csiph-web