Bug 493045 - memory leak when reading from files mounted with nfs mount option 'noac'
Summary: memory leak when reading from files mounted with nfs mount option 'noac'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.3
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Peter Staubach
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: 588221 1065866
TreeView+ depends on / blocked
 
Reported: 2009-03-31 12:50 UTC by Sachin Prabhu
Modified: 2018-10-20 03:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1065866 (view as bug list)
Environment:
Last Closed: 2009-09-02 08:36:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (264 bytes, patch)
2009-04-02 19:43 UTC, Peter Staubach
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1243 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.4 kernel security and bug fix update 2009-09-01 08:53:34 UTC

Description Sachin Prabhu 2009-03-31 12:50:10 UTC
When reading files from a share mounted with the noac option, the number of active nfs_read_data slabcache objects steadily increase and are never freed.

Reproducer:

We need 2 systems. A NFS server and a client. The nfs share exported by the nfs server is mounted on the client with the options 'noac'.

On a directory exported by the nfs server run the following command

while :;
     do dd if=/dev/zero of=.test bs=1M count=10;
     sleep 1;
     rm -f .test;
done

This command reads 10M of data from /dev/zero and copies it to .test. It sleeps for 1 second to allow the client to read .test before deleting it. It runs this in a loop.

On the NFS client, use one terminal to simply read this file in a loop with the following command

while :;
     do cat .test;
done

On another terminal, keep a check on nfs_read_data in /proc/slabinfo
watch grep nfs_read /proc/slabinfo

You should see the number of nfs_read_data active slabcache objects steadily increasing. These are not freed even when the share is unmounted.

On attempting to rmmod the nfs module, the kernel panics. I am not sure if this is however directly related to this memory leak issue.

Comment 1 Sachin Prabhu 2009-03-31 12:58:03 UTC
We do not see this memory leak when using attribute caching.

Comment 2 Peter Staubach 2009-04-02 19:43:55 UTC
Created attachment 337887 [details]
Proposed patch

The use of the "noac" mount option causes the NFS client to do synchronous
reads when reading a file.  As far as I can tell, this is only the way to
get the NFS client to do this.

Interestingly, the leak was in the normal, ie. read succeeded, path.  The
error path handled the memory correctly and freed it.  The normal path was
not freeing the allocated memory.

Comment 4 RHEL Program Management 2009-04-24 19:48:43 UTC
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 5 Don Zickus 2009-05-06 17:17:23 UTC
in kernel-2.6.18-144.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 7 Chris Ward 2009-07-03 18:28:15 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 10 errata-xmlrpc 2009-09-02 08:36:10 UTC
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-1243.html


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