Bug 445795 - /proc filesystem in RHEL4 doesn't follow usual unix filesystem conventions
/proc filesystem in RHEL4 doesn't follow usual unix filesystem conventions
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.8
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jiri Pirko
Martin Jenner
:
Depends On:
Blocks: RHEL4u8_relnotes 461304
  Show dependency treegraph
 
Reported: 2008-05-09 04:42 EDT by Jan Lieskovsky
Modified: 2015-05-04 21:14 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 15:31:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Lieskovsky 2008-05-09 04:42:23 EDT
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:
Comment 1 Eric Sandeen 2008-05-10 01:46:54 EDT
[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.
Comment 2 RHEL Product and Program Management 2008-06-30 17:32:18 EDT
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.
Comment 4 RHEL Product and Program Management 2008-09-03 09:15:07 EDT
Updating PM score.
Comment 5 Vivek Goyal 2009-01-05 09:18:14 EST
Committed in 78.23.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 9 Jiri Pirko 2009-03-18 07:55:01 EDT
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.
Comment 11 errata-xmlrpc 2009-05-18 15:31:57 EDT
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

Note You need to log in before you can comment on or make changes to this bug.