This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 511312 - Add support for lookupcache= option in nfsv4
Add support for lookupcache= option in nfsv4
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Steve Dickson
yanfu,wang
: Reopened
Depends On:
Blocks: 706305
  Show dependency treegraph
 
Reported: 2009-07-14 12:32 EDT by Sachin Prabhu
Modified: 2017-05-05 00:07 EDT (History)
3 users (show)

See Also:
Fixed In Version: nfs-utils-1.0.9-52.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 706305 (view as bug list)
Environment:
Last Closed: 2011-07-21 07:34:31 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)
Proposed patch (2.90 KB, patch)
2009-07-14 14:58 EDT, Sachin Prabhu
no flags Details | Diff

  None (edit)
Description Sachin Prabhu 2009-07-14 12:32:20 EDT
The kernel patch required to enable this option is handled in bz 489285 and was included in kernel-2.6.18-136.el5.

BZ 489335 was opened to add support for lookupcache= option in mount.nfs. This support was added in nfs-utils-1.0.9-42

This bz has been opened to add support for lookupcache= option in mount.nfs4.
Comment 1 Steve Dickson 2009-07-14 13:22:27 EDT
Sachin,

Could you please post a reproducer if one exists... tia...
Comment 2 Sachin Prabhu 2009-07-14 14:54:19 EDT
Reproducer:

A simple reproducer to reproduce the negative lookup problem

Consider the following nfsv4 exports.
/export      *(sync,rw,fsid=0,insecure,no_subtree_check,anonuid=65534,anongid=65534)

#mount it over local loopback for testing purposes and cd into it.
[root@vm22 ~]# mount -t nfs4 localhost:/ /mnt
[root@vm22 ~]# cd /mnt

#run the test
[root@vm22 mnt]# rm -f t1;cat t1;date >/export/t1;cat t1
cat: t1: No such file or directory
cat: t1: No such file or directory

In this case, the first lookup will generate the negative lookup.
The file is then created on the exported share on the server.
The cached negative lookup means that second lookup will be served from cache and will report No such file or directory.
Comment 3 Sachin Prabhu 2009-07-14 14:58:08 EDT
Created attachment 351653 [details]
Proposed patch

Proposed patch to add support for lookupcache= in mount.nfs4
Comment 5 Sachin Prabhu 2009-07-14 15:09:30 EDT
A test package built using the proposed patch from c#3 was used for the reproducer attempt below.

#mount nfs4 export using the option
# __lookupcache=pos__
#to disable caching of negative lookups.

[root@vm22 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /mnt
[root@vm22 ~]# cd /mnt

#Now run the reproducer commands
[root@vm22 mnt]# rm -f t1;cat t1;date >/export/t1;cat t1
cat: t1: No such file or directory
Tue Jul 14 22:22:01 BST 2009

In this case, the negative lookup from the first 'cat' command is not cached and the contents of the new file are printed instead.
Comment 9 RHEL Product and Program Management 2010-09-16 13:17:47 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 13 RHEL Product and Program Management 2011-01-11 15:06:44 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 14 RHEL Product and Program Management 2011-01-11 18:11:02 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 16 yanfu,wang 2011-05-17 02:15:09 EDT
reproduced on nfs-utils-1.0.9-51.el5:
[root@sun-x4200-01 export]# rpm -qa|grep nfs-utils
nfs-utils-1.0.9-51.el5
nfs-utils-lib-1.0.8-7.6.el5

[root@sun-x4200-01 ~]# cat /etc/exports 
/tmp *(sync,rw,fsid=0,insecure,no_subtree_check,anonuid=65534,anongid=65534)
[root@sun-x4200-01 ~]# mkdir /export
[root@sun-x4200-01 ~]# /etc/init.d/nfs restart

[root@sun-x4200-01 ~]# mount -t nfs4 localhost:/ /export
[root@sun-x4200-01 ~]# cat /proc/mounts 
...
localhost:/ /export nfs4 rw,vers=4,rsize=32768,wsize=32768,hard,intr,proto=tcp,timeo=600,retrans=3,sec=sys,addr=localhost 0 0

[root@sun-x4200-01 ~]# cd /export/
[root@sun-x4200-01 export]# rm -f t1;cat t1;date >/tmp/t1;cat t1
cat: t1: No such file or directory
cat: t1: No such file or directory

[root@sun-x4200-01 export]# cd
[root@sun-x4200-01 export]# umount /export/

[root@sun-x4200-01 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /export
unknown nfs mount parameter: lookupcache=0


verified on nfs-utils-1.0.9-52.el5 on i386 and x86_64:
[root@hp-xw6400-02 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /mnt
...
localhost:/ on /mnt type nfs4 (rw,lookupcache=pos,addr=127.0.0.1)

[root@hp-xw6400-02 mnt]# rm -f t1;cat t1;date >/export/t1;cat t1
cat: t1: No such file or directory
Tue May 17 02:12:06 EDT 2011
Comment 17 yanfu,wang 2011-05-17 02:19:32 EDT
hi Steve,
I've verified the bug as above comment, but I have one question and want to confirm with you.
Q: I couldn't get lookupcache option from /proc/mounts, is it ok?
[root@hp-xw6400-02 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /mnt
[root@hp-xw6400-02 mnt]# mount
...
localhost:/ on /mnt type nfs4 (rw,lookupcache=pos,addr=127.0.0.1) ==> it's here

[root@hp-xw6400-02 mnt]# cat /proc/mounts 
...
localhost:/ /mnt nfs4 rw,vers=4,rsize=32768,wsize=32768,hard,intr,proto=tcp,timeo=600,retrans=3,sec=sys,addr=localhost 0 0   ==> none?
Comment 18 Steve Dickson 2011-05-19 07:52:26 EDT
(In reply to comment #17)
> hi Steve,
> I've verified the bug as above comment, but I have one question and want to
> confirm with you.
> Q: I couldn't get lookupcache option from /proc/mounts, is it ok?
> [root@hp-xw6400-02 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /mnt
> [root@hp-xw6400-02 mnt]# mount
> ...
> localhost:/ on /mnt type nfs4 (rw,lookupcache=pos,addr=127.0.0.1) ==> it's here
> 
> [root@hp-xw6400-02 mnt]# cat /proc/mounts 
> ...
> localhost:/ /mnt nfs4
> rw,vers=4,rsize=32768,wsize=32768,hard,intr,proto=tcp,timeo=600,retrans=3,sec=sys,addr=localhost
> 0 0   ==> none?
Interesting... It is a nit.... but I think your are correct in
expecting the lookupcache value to be in /proc/mounts

Go head and open an other bz on it... Nice work!

steved.
Comment 19 yanfu,wang 2011-05-22 22:50:28 EDT
(In reply to comment #18)
> (In reply to comment #17)
> > hi Steve,
> > I've verified the bug as above comment, but I have one question and want to
> > confirm with you.
> > Q: I couldn't get lookupcache option from /proc/mounts, is it ok?
> > [root@hp-xw6400-02 ~]# mount -t nfs4 -o lookupcache=pos localhost:/ /mnt
> > [root@hp-xw6400-02 mnt]# mount
> > ...
> > localhost:/ on /mnt type nfs4 (rw,lookupcache=pos,addr=127.0.0.1) ==> it's here
> > 
> > [root@hp-xw6400-02 mnt]# cat /proc/mounts 
> > ...
> > localhost:/ /mnt nfs4
> > rw,vers=4,rsize=32768,wsize=32768,hard,intr,proto=tcp,timeo=600,retrans=3,sec=sys,addr=localhost
> > 0 0   ==> none?
> Interesting... It is a nit.... but I think your are correct in
> expecting the lookupcache value to be in /proc/mounts
> 
> Go head and open an other bz on it... Nice work!
> 
> steved.

verified as comment #16 and file a new bug 706305 against the above comment.
Comment 20 errata-xmlrpc 2011-07-21 07:34:31 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/RHBA-2011-1048.html

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