Bug 511312 - Add support for lookupcache= option in nfsv4
Summary: Add support for lookupcache= option in nfsv4
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: yanfu,wang
URL:
Whiteboard:
Depends On:
Blocks: 706305
TreeView+ depends on / blocked
 
Reported: 2009-07-14 16:32 UTC by Sachin Prabhu
Modified: 2017-05-05 04:07 UTC (History)
3 users (show)

Fixed In Version: nfs-utils-1.0.9-52.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 706305 (view as bug list)
Environment:
Last Closed: 2011-07-21 11:34:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (2.90 KB, patch)
2009-07-14 18:58 UTC, Sachin Prabhu
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1048 0 normal SHIPPED_LIVE nfs-utils bug fix and enhancement update 2011-07-20 15:43:36 UTC

Description Sachin Prabhu 2009-07-14 16:32:20 UTC
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 17:22:27 UTC
Sachin,

Could you please post a reproducer if one exists... tia...

Comment 2 Sachin Prabhu 2009-07-14 18:54:19 UTC
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 18:58:08 UTC
Created attachment 351653 [details]
Proposed patch

Proposed patch to add support for lookupcache= in mount.nfs4

Comment 5 Sachin Prabhu 2009-07-14 19:09:30 UTC
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 Program Management 2010-09-16 17:17:47 UTC
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 Program Management 2011-01-11 20:06:44 UTC
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 Program Management 2011-01-11 23:11:02 UTC
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 06:15:09 UTC
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 06:19:32 UTC
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 11:52:26 UTC
(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-23 02:50:28 UTC
(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 11:34:31 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/RHBA-2011-1048.html


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