]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix an erroneous stat failure with bind mounts
authorPádraig Brady <P@draigBrady.com>
Mon, 20 Sep 2010 14:07:02 +0000 (15:07 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 20 Sep 2010 14:07:02 +0000 (15:07 +0100)
* tests/misc/stat-mount: Don't try to correlate the
mount points output by df and stat, as they're similar,
but sometimes different in the presence of bind mounts.
* doc/coretuils.texi (stat invocation): Clarify the
bind mount difference between stat and df.

doc/coreutils.texi
tests/misc/stat-mount

index 72ee450d3ba8e0d8b220e9690d8dd0c7826eb90a..170ce0c378a6a3c37bd55e5d0a493f7e1ee053e8 100644 (file)
@@ -10715,9 +10715,10 @@ stat does not search for specified device nodes in the
 file system list, instead operating on them directly
 @item
 @cindex bind mount
-stat outputs the alias for a bind mounted file,
-rather than its backing device.  One can recursively call stat
-until there is no change in output, to get the base mount point
+stat outputs the alias for a bind mounted file, rather than
+the initial mount point of its backing device.
+One can recursively call stat until there is no change in output,
+to get the current base mount point
 @end itemize
 
 When listing file system information (@option{--file-system} (@option{-f})),
index c1c43d49cf274137cc4ef9fc283f7a92a9c97311..a99291f6dec3f161a8bd4c884ba67988f4a0626a 100755 (executable)
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 
-# Note we assume that the current directory is not bind mounted
-# (as then, stat and df may have different results).
-# This should be the case given the directory is temporary
-# for the duration of the test.
-
 df_mnt=$(df -P . | sed -n '2s/.* \([^ ]*$\)/\1/p')
-stat_mnt=$(stat -c%m .)
-
-test "$df_mnt" = "$stat_mnt" || fail=1
+stat_mnt=$(stat -c%m .) || fail=1
+test "$stat_mnt" || fail=1
 
 Exit $fail