Find should not record and exit with an error status on cyclic directories (bind mounted)

Solution Verified - Updated -

Issue

  • /usr/bin/find directories with .snapshot return exit code 1 (echo $? = 1) on RHEL 6.4 servers. the same command on RHEL 5.x works fine.
  • Example of warning message from both 6.4 and 5.x servers:
find: File system loop detected; `/gfs/amm/data_log/.snapshot' is part of the same file system loop as `/gfs/amm/data_log'.

OR

 $ mkdir -p a/b
> $ sudo mount --bind a a/b
> $ find a; echo $?
> a
> find: File system loop detected; ‘a/b’ is part of the same file system loop as ‘a’.
> 1    <========================== it should be 0

Environment

  • Red Hat Enterprise Linux 6
  • findutils-4.4.2-6.el6.x86_64
  • findutils-4.2.27-6.el5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.