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.
Sachin, Could you please post a reproducer if one exists... tia...
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.
Created attachment 351653 [details] Proposed patch Proposed patch to add support for lookupcache= in mount.nfs4
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.
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.
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.
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
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?
(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.
(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.
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