From: "Pádraig Brady" <P@draigBrady.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Detecting bind-mounts
Date: Sat, 06 Nov 2010 10:57:29 +0000 [thread overview]
Message-ID: <4CD53499.90308@draigBrady.com> (raw)
In-Reply-To: <4CD4A5B4.5090204@msgid.tls.msk.ru>
On 06/11/10 00:47, Michael Tokarev wrote:
> 06.11.2010 03:32, Pádraig Brady wrote:
> []
>> As for a fast way, I don't think one exists.
>> BTW I'm not sure your examples are actually valid.
>> If a file/dir is bind mounted to the same file system, then
>> `find -xdev` should be listing it (as it has the same dev).
>
> Think what, say, cp or tar with --one-file-system option are
> used for. It is usually to copy a system to another place.
> There, we only want single copy of everything, and with current
> situation it will be two, with additional mess with hardlinks
> for files wich were hardlinks already (due to optimizations
> done by the utils based on link counts).
Fair enough, but that starts to overlap with how hardlinks
are handled. If you're following symlinks then you can't
use the hardlink count. Note the du utility has recently
handled this by using a "di-set" to efficiently exclude
duplicate dev,inode pairs.
>
> find -xdev is a bit different since it explicitly mentions
> "dev", and in my examples the device is actually the same.
> But usage case can be the same as for cp/tar above too, or
> may be different.
>
>> You want a separate option --same-mount or something,
>> though I don't know what it would be useful for.
>
> Stopping at the bind-mount dir definitely is useful, see
> above for the "main" (and very important) usage case (this
> can be solved differently on linux too - by cloning a new
> namespace and removing the bind mounts before doing that
> copy. but this is, again, ugly at best).
>
> Note that this "main" usage case requires fast way to
> determine mount points...
I can see how it would be useful, yes.
cheers,
Pádraig.
prev parent reply other threads:[~2010-11-06 10:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 20:45 Detecting bind-mounts Michael Tokarev
2010-11-05 10:24 ` Pádraig Brady
2010-11-05 18:30 ` Michael Tokarev
2010-11-05 20:30 ` Michael Tokarev
2010-11-06 0:32 ` Pádraig Brady
2010-11-06 0:47 ` Michael Tokarev
2010-11-06 10:57 ` Pádraig Brady [this message]
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=4CD53499.90308@draigBrady.com \
--to=p@draigbrady.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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