The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: random832@fastmail.com (Random832)
Subject: [TUHS] Device special files
Date: Thu, 08 Feb 2018 13:59:49 -0500	[thread overview]
Message-ID: <1518116389.3085544.1264358560.45B003A3@webmail.messagingengine.com> (raw)
In-Reply-To: <01b001d3a065$d3ee30a0$7bca91e0$@ronnatalie.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

On Wed, Feb 7, 2018, at 17:48, Ron Natalie wrote:
> Amusingly, we still found bugs.    I was griping that people would mount 
> on just any directory on the system, the mtab wouldn’t show the absolute 
> path.    I suggested we chdir to / early on or better yet, cd to /dev.  
> That way I wouldn’t have to type /dev/ on to the device name.     I say 
> the user would have to give an absolute path anyhow since there’s 
> nothing on /dev to mount on.    Well my roommate immediately tries to 
> prove me wrong.   He tries passing various devnodes and regular files 
> that happen to sit in /dev.   Then he gets the great idea of mounting 
> on /dev/.     It works, but now we have no way to unmount it.   We had 
> to reboot the machine.    I quickly modified mount to require an EMPTY 
> directory owned by the user to be required for mounting.

Would a mknod (in the new /dev or anywhere else) to "recreate" the device file have worked? Requiring an empty directory seems a bit overkill vs simply requiring an absolute path (perhaps one that does not begin with /dev) or having the mount command calculate the absolute path.

(I'm mildly surprised that if this was in the era where . and .. were simply hardlinks created by mkdir(1), mounting on /dev/. didn't simply literally mount on /dev/. leaving /dev alone, which would have been an interesting state but wouldn't have prevented unmounting)

Why is it that umount(2) took the device special file name rather than the mount point directory name, anyway? This seems to have been fixed in NFSv2, 4.3BSD-Uwisc, and Linux, but why was it like that in the first place? It *seems* like in the V6 era code the system could have just as well checked m_inodp for a match to the directory as m_dev for the device.


  reply	other threads:[~2018-02-08 18:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 15:56 ron minnich
2018-02-06 17:56 ` Larry McVoy
2018-02-06 18:03   ` ron minnich
2018-02-06 19:48 ` Random832
2018-02-07  1:25   ` Greg 'groggy' Lehey
2018-02-07  1:36     ` Ron Natalie
2018-02-07  1:40       ` Clem Cole
2018-02-07  1:47         ` Henry Bent
2018-02-07  1:48     ` Dave Horsfall
2018-02-07  2:06       ` Dan Cross
2018-02-07 16:24         ` Arthur Krewat
2018-02-07 16:34           ` Dan Cross
2018-02-07 16:34           ` Nemo
2018-02-07 16:59             ` ron minnich
2018-02-08  0:39           ` Dave Horsfall
2018-02-08 16:18             ` Arthur Krewat
2018-02-08 22:47               ` Dave Horsfall
2018-02-07  2:13       ` Bakul Shah
2018-02-07  5:39         ` Dave Horsfall
2018-02-07 18:36           ` Steffen Nurpmeso
2018-02-07 19:07             ` Ian Zimmerman
2018-02-07 22:05               ` Clem Cole
2018-02-07 22:38                 ` ron minnich
2018-02-07 22:48                 ` Ron Natalie
2018-02-08 18:59                   ` Random832 [this message]
2018-02-07 23:06                 ` Bakul Shah
2018-02-08 19:06               ` Steffen Nurpmeso
2018-02-07 22:04             ` Dave Horsfall
2018-02-08 13:03               ` Rafael R Obelheiro
2018-02-08 19:25               ` Steffen Nurpmeso
2018-02-07  1:38 Noel Chiappa
2018-02-09  0:09 Doug McIlroy

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=1518116389.3085544.1264358560.45B003A3@webmail.messagingengine.com \
    --to=random832@fastmail.com \
    /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).