All of lore.kernel.org
 help / color / mirror / Atom feed
From: L A Walsh <lkml@tlinx.org>
To: util-linux@vger.kernel.org
Subject: util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged
Date: Sat, 15 Apr 2017 18:08:17 -0700	[thread overview]
Message-ID: <58F2C401.5090001@tlinx.org> (raw)


mountpoint doesn't detect file, device
or other inode mount points.

Also, the "-d" switch doesn't show the maj:min of the mounted
inode.  Of note: "-x" does show the maj:min of a remounted blockdev.

#reproduce (showing additional variant w/a char device)

cd /tmp
mkdir foo1
cd foo1
mkdir mnt
sudo mount tmpfs -t tmpfs mnt
touch mnt/file mnt_file mnt_null
sudo mknod mnt/null c 1 3
sudo mount --bind mnt/file mnt_file
sudo mount --bind mnt/null mnt_null
function is_mountedQ {
  if /usr/bin/mountpoint -q $1; then
    echo "$1 is a mount point"
  else
    echo "$1 is not a mount point"
  fi
}
is_mountedQ mnt_file
is_mountedQ mnt_null

------------
Note, -x does show a remounted dev:

Ishtar:/tmp/foo1/mnt> sudo mknod sda b 8 0
Ishtar:/tmp/foo1> ll mnt/sda
  brw-rw-r-- 1 8, 0 Apr 15 17:59 mnt/sda
Ishtar:/tmp/foo1> touch mnt_sda
Ishtar:/tmp/foo1> sudo mount --bind mnt/sda mnt_sda
Ishtar:/tmp/foo1> ll mnt_sda
  brw-rw-r-- 1 8, 0 Apr 15 17:59 mnt_sda
Ishtar:/tmp/foo1> mountpoint -x mnt_sda
  8:0

"mount |grep foo1" shows all the mount points:

Ishtar:/tmp/foo1> mount |grep foo1
tmpfs on /tmp/foo1/mnt type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_file type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_null type tmpfs (rw,relatime)
tmpfs on /tmp/foo1/mnt_sda type tmpfs (rw,relatime)

======
Side (or end) note:
Besides "mountpoint" handling mounted inodes, it **could**
be "more complete" by being enhanced to:

1) scan all names on its command line
2) scan all inodes in a directory
  or
3) scan all inodes recursively, starting at a directory



             reply	other threads:[~2017-04-16  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-16  1:08 L A Walsh [this message]
2017-05-10  9:47 ` util-linux-v2.25:mountpoint misnamed or bugged, and "-d" bugged Karel Zak
2017-05-10  9:49   ` Karel Zak

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=58F2C401.5090001@tlinx.org \
    --to=lkml@tlinx.org \
    --cc=util-linux@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.