Bug#449338: find -xdev crosses -obind mountpoints

2007-11-05 Thread Peter Chubb

Package: findutils
Version: 4.2.31-1

-xdev isn't supposed to cross mountpoints, but it can if the
subdirectory is on the same device.

To show the problem:

mkdir -p a/b/c/d
cd a
mkdir e
 e/foo
mount -obind e b/c/d
find b -xdev

find prints b/c/d/foo which is across the mountpoint.

On my system, this causes some large directories (/home) to be backed
up multiple times because they're bind-mounted in /var/chroot/xxx/home


--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au   ERTOS within National ICT Australia



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#449338: find -xdev crosses -obind mountpoints

2007-11-05 Thread Andreas Metzler
On 2007-11-05 Peter Chubb [EMAIL PROTECTED] wrote:

 Package: findutils
 Version: 4.2.31-1

 -xdev isn't supposed to cross mountpoints, but it can if the
 subdirectory is on the same device.
[...]

Hello,
This is kind of documented behavior, find does not care about
mountpoints, it cares about filesystems/devices. The bind mounted
stuff still lifes on the same device according to stat.

| -- Option: -xdev
| -- Option: -mount
| Don't descend directories on other filesystems.  These options are
| synonyms.

This is also the way POSIX/SUSv2 specifies it:

| -xdev
| The primary shall always evaluate as true; it shall cause find not
| to continue descending past directories that have a different
| device ID ( st_dev, see the stat() function defined in the System
| Interfaces volume of IEEE Std 1003.1-2001). If any -xdev primary
| is specified, it shall apply to the entire expression even if the
| -xdev primary would not normally be evaluated.

cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]