Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: Ruediger Meier <sweet_f_a@gmx.de>, util-linux@vger.kernel.org
Subject: Re: question about findmnt --target
Date: Wed, 18 Mar 2015 11:17:18 +0100	[thread overview]
Message-ID: <20150318101718.GB28925@ws.net.home> (raw)
In-Reply-To: <55092A36.7060004@bernhard-voelker.de>

On Wed, Mar 18, 2015 at 08:33:10AM +0100, Bernhard Voelker wrote:
> On 03/17/2015 05:34 PM, Karel Zak wrote:
> > Maybe we need a new option to disable the evaluation of the target
> > path elements. (--strict-target)
> 
> Hey, we already have a tool for that: 'mountpoint' ;-)

 Yes, it's possible solution, but if we think about findmnt as
 "complete" tool to search in mount tables than I expect that it
 provides all necessary functionality.

> What's wrong with
> 
>   mountpoint "$DIR_B" >/dev/null \
>     && findmnt --target "$DIR_B" \
>     && ...

 race, if you umount between mountpoint and findmnt.
 
 And it will also read and parse /proc/self/mountinfo in both tools. 
 
 And force kernel to compose mount table is already reported performance 
 issue on some large systems. The real solution and long-term wish is to 
 have per-mountpoint kernel API, something like
 
    fd = mountfd("/mnt", O_RDONLY);
    read(fd, buf, sizeof(fs_mountinfo));

 and in O_RDWR to mount, remount and umount, and then send old mount(2)
 syscall to hell...

   Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-03-18 10:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 15:08 question about findmnt --target Ruediger Meier
2015-03-17 16:34 ` Karel Zak
2015-03-17 17:14   ` Ruediger Meier
2015-03-17 19:25     ` Karel Zak
2015-03-18 13:50       ` Ruediger Meier
2015-03-18 22:05         ` Karel Zak
2015-03-18  7:33   ` Bernhard Voelker
2015-03-18 10:17     ` Karel Zak [this message]
2015-03-18 10:39     ` Ruediger Meier
2015-03-18 11:22       ` 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=20150318101718.GB28925@ws.net.home \
    --to=kzak@redhat.com \
    --cc=mail@bernhard-voelker.de \
    --cc=sweet_f_a@gmx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox