Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 489285

Summary: Backport lookupcache= mount option for nfs shares
Product: Red Hat Enterprise Linux 5 Reporter: Sachin Prabhu <sprabhu>
Component: kernelAssignee: Sachin Prabhu <sprabhu>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: cward, djuran, dzickus, jiyin, jlayton, lmcilroy, moshiro, rlerch, staubach, steved, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The lookupcache nfs mount option is only available for NFS v3 in this release. Support for NFSv4 may be introduced in a future Red Hat Enterprise Linux 5 update. Please refer to Red Hat bugzilla 511312 for further information.
Story Points: ---
Clone Of:
: 489335 (view as bug list) Environment:
Last Closed: 2009-09-02 09:02:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 489335    
Attachments:
Description Flags
Reproducer for the negative lookup problem seen at customer
none
Add finer grained control over lookup cache.
none
Add lookupcache mount option none

Description Sachin Prabhu 2009-03-09 10:44:31 UTC
A customer is facing a problem caused by a negative lookup in the same second the file is created on another machine. Since the mtime on the directory does not change, the negative lookup never expires. The customer tried using an upstream kernel with the lookupcache=pos option and confirmed that it works for them.

This request is to backport the following GIT commits to enable finer grain control over the lookup cache.

commit 4eec952e42314b53e48fef1f54dd89cbf9789734
Author: Trond Myklebust <Trond.Myklebust>
Date:   Tue Jul 15 17:58:13 2008 -0400

    NFS: Add options for finer control of the lookup cache
    
    Add the flag NFS_MOUNT_LOOKUP_CACHE_NONEG to turn off the caching of
    negative dentries. In reality what we do is to force
    nfs_lookup_revalidate() to always discard negative dentries.
    
    Add the flag NFS_MOUNT_LOOKUP_CACHE_NONE for enforcing stricter
    revalidation of dentries. It forces the revalidate code to always do a
    lookup instead of just checking the cached mtime of the parent directory.
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust>



commit 7973c1f15a0687f47ed70e591e4642d6fc4334d0
Author: Trond Myklebust <Trond.Myklebust>
Date:   Tue Jul 15 17:58:14 2008 -0400

    NFS: Add mount options for controlling the lookup cache
    
    Add the following NFS-specific mount options to the parser.
    
        -o lookupcache=all          /* Default: cache positive & negative
                                       dentries */
        -o lookupcache=pos[itive]   /* Don't cache negative dentries */
        -o lookupcache=none         /* Strict revalidation of all dentries */
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust>

The corresponding changes will also have to be made to the nfs-utils directory.

Comment 1 Sachin Prabhu 2009-03-09 10:48:47 UTC
Created attachment 334489 [details]
Reproducer for the negative lookup problem seen at customer

Reproducer for negative lookup problem seen on customer systems. 

2 machines mounting the nfs share on the same location are required. Change the remote_machine and set it to the hostname of the second client machine. ssh keys will have to be set to allow reproducing user to login into the second machine to execute commands.

The reproducer aims to do a negative lookup within the same second the file is created on the second machine. Since the mtime on the directory is not modified, the negative lookup on the first machine never expires.

Comment 2 Sachin Prabhu 2009-03-09 15:26:35 UTC
Created attachment 334538 [details]
Add finer grained control over lookup cache.

Proposed Patch 1 of 2.

Backport of:


commit 4eec952e42314b53e48fef1f54dd89cbf9789734
Author: Trond Myklebust <Trond.Myklebust>
Date:   Tue Jul 15 17:58:13 2008 -0400

    NFS: Add options for finer control of the lookup cache
    
    Add the flag NFS_MOUNT_LOOKUP_CACHE_NONEG to turn off the caching of
    negative dentries. In reality what we do is to force
    nfs_lookup_revalidate() to always discard negative dentries.
    
    Add the flag NFS_MOUNT_LOOKUP_CACHE_NONE for enforcing stricter
    revalidation of dentries. It forces the revalidate code to always do a
    lookup instead of just checking the cached mtime of the parent directory.
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust>

Comment 3 Sachin Prabhu 2009-03-09 15:28:21 UTC
Created attachment 334540 [details]
Add lookupcache mount option

Patch 2 of 2

Backport of:

commit 7973c1f15a0687f47ed70e591e4642d6fc4334d0
Author: Trond Myklebust <Trond.Myklebust>
Date:   Tue Jul 15 17:58:14 2008 -0400

    NFS: Add mount options for controlling the lookup cache
    
    Add the following NFS-specific mount options to the parser.
    
        -o lookupcache=all          /* Default: cache positive & negative
                                       dentries */
        -o lookupcache=pos[itive]   /* Don't cache negative dentries */
        -o lookupcache=none         /* Strict revalidation of all dentries */
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust>

Comment 4 Sachin Prabhu 2009-03-13 15:49:44 UTC
BZ 489335: Add lookupcache option for the userland nfs-utils package.

Comment 7 RHEL Program Management 2009-03-20 00:48:15 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 8 Don Zickus 2009-03-23 15:53:32 UTC
in kernel-2.6.18-136.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 10 Lachlan McIlroy 2009-05-20 05:21:00 UTC
*** Bug 500528 has been marked as a duplicate of this bug. ***

Comment 12 Chris Ward 2009-07-03 18:26:45 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 13 Lachlan McIlroy 2009-07-10 05:10:44 UTC
We appear to be missing the necessary code in RHEL5 for nfs4 mounts to recognise the lookupcache option.  On nfs4 mounts I get

# mount -t nfs4 -o lookupcache=all 192.168.122.11:/ /mnt
unknown nfs mount parameter: lookupcache=0

Is there any intention to get this support added?

Comment 23 Ondrej Hudlicky 2009-07-16 11:57:23 UTC
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:
The lookupcache nfs mount option is only available for NFS v3 in this release. Support for NFSv4 may be introduced in a future Red Hat Enterprise Linux 5
update. Please refer to Red Hat bugzilla 511312 for further information.

Comment 26 errata-xmlrpc 2009-09-02 09:02:04 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