Bug 489285 - Backport lookupcache= mount option for nfs shares
Backport lookupcache= mount option for nfs shares
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Sachin Prabhu
Red Hat Kernel QE team
:
: 500528 (view as bug list)
Depends On:
Blocks: 489335
  Show dependency treegraph
 
Reported: 2009-03-09 06:44 EDT by Sachin Prabhu
Modified: 2014-11-13 01:01 EST (History)
11 users (show)

See Also:
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 05:02:04 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)
Reproducer for the negative lookup problem seen at customer (1.60 KB, text/plain)
2009-03-09 06:48 EDT, Sachin Prabhu
no flags Details
Add finer grained control over lookup cache. (1.41 KB, patch)
2009-03-09 11:26 EDT, Sachin Prabhu
no flags Details | Diff
Add lookupcache mount option (1.61 KB, patch)
2009-03-09 11:28 EDT, Sachin Prabhu
no flags Details | Diff

  None (edit)
Description Sachin Prabhu 2009-03-09 06:44:31 EDT
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@netapp.com>
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@netapp.com>



commit 7973c1f15a0687f47ed70e591e4642d6fc4334d0
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
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@netapp.com>

The corresponding changes will also have to be made to the nfs-utils directory.
Comment 1 Sachin Prabhu 2009-03-09 06:48:47 EDT
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 11:26:35 EDT
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@netapp.com>
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@netapp.com>
Comment 3 Sachin Prabhu 2009-03-09 11:28:21 EDT
Created attachment 334540 [details]
Add lookupcache mount option

Patch 2 of 2

Backport of:

commit 7973c1f15a0687f47ed70e591e4642d6fc4334d0
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
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@netapp.com>
Comment 4 Sachin Prabhu 2009-03-13 11:49:44 EDT
BZ 489335: Add lookupcache option for the userland nfs-utils package.
Comment 7 RHEL Product and Program Management 2009-03-19 20:48:15 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 8 Don Zickus 2009-03-23 11:53:32 EDT
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 01:21:00 EDT
*** Bug 500528 has been marked as a duplicate of this bug. ***
Comment 12 Chris Ward 2009-07-03 14:26:45 EDT
~~ 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 01:10:44 EDT
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 07:57:23 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:
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 05:02:04 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-1243.html

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