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.
We do not see this memory leak when using attribute caching.
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.
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.
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.
~~ 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.
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