Description of problem: The -noleaf option of the find command has the following meaning: Do not optimize by assuming that directories contain 2 fewer subdirectories than their hard link count. This option needs to be used on RHEL4 kernel to display correct count of files with permissions for example of 666: Version-Release number of selected component (if applicable): 2.6.9-67.0.7.EL How reproducible: Always Steps to Reproduce: 1. find /proc -perm 666 | wc -l find: /proc/29869/task/29869/fd/4: No such file or directory 0 2. Find claims there are no files in /proc filesystem with permissions of 666. 3. But when using -noleaf option to the "find" command, the correct number of files with 666 permissions is found: # find /proc -noleaf -perm 666 | wc -l find: /proc/29908/task/29908/fd/4: No such file or directory find: /proc/29908/fd/4: No such file or directory 435 4. The same command on RHEL5(2.6.18-53.1.14.el5): # find /proc -perm 666 | wc -l find: /proc/17104/task/17104/fd/4: No such file or directory find: /proc/17104/fd/4: No such file or directory 1215 5. The output of "find -noleaf" command on RHEL5: # find /proc -noleaf -perm 666 | wc -l find: /proc/17113/task/17113/fd/4: No such file or directory find: /proc/17113/fd/4: No such file or directory 1215 Actual results: The number of files in /proc filesystem with specific permission type is the same on RHEL5 (with or without using -noleaf option), while on RHEL4 the output differs. Expected results: The output of "find -noleaf" command should be the same with or without using the -noleaf option -- i.e. RHEL-4 /proc filesystem should follow the Unix filesystem conventions. Additional info:
[PATCH] procfs: Fix hardlink counts for /proc/<PID>/task http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f246315e1ab96c40978777d1e159820ecca45aa8 and [PATCH] procfs: Fix hardlink counts http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bcf88e1163623e8e8ef2ba7feface9c826a890c9 look like the place to start for upstream fixes.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Updating PM score.
Committed in 78.23.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Release note added. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: Bug was in the kernel for a long time. Consequence: Behaviour of /proc filesystem was different from unix usual. Fix: There were backported relevant pieces of code from upstream kernel do do the counting right. Result: Now the behaviour is correct and it follows the usual unix filesystem conventions.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-1024.html