Re: question about findmnt --target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux