diff -up nfs-utils-1.0.9/utils/mount/nfs.man.orig nfs-utils-1.0.9/utils/mount/nfs.man --- nfs-utils-1.0.9/utils/mount/nfs.man.orig 2009-05-01 09:03:23.729039000 -0700 +++ nfs-utils-1.0.9/utils/mount/nfs.man 2009-05-01 10:31:59.005578000 -0700 @@ -302,6 +302,28 @@ options. Use of this option is not recommended unless you are certain that there are no hard links or subtrees of this mountpoint that are mounted elsewhere. +.TP 1.5i +.I lookupcache=type +This option dictates how directories and files should be cached when +they are accessed -- i.e. "looked up" -- on the server. A lookup +can be either positive (directory/file was found) or +negative (directory/file was not found); both types of lookups can be cached. +.br +.sp +By default, both positive and negative lookups are cached ( +.B lookupcache=all +). +.B lookupcache=pos +prevents negative lookups from being cached, while +.B lookupcache=none +prevents all lookups from being cached. +.br +.sp +.B Note: +lookupcache=none +can adversely affect performance, but may be necessary +if shared files created or deleted on the server need to be immediately +visible to any applications running on NFS clients. .P All of the non-value options have corresponding nooption forms. For example, nointr means don't allow file operations to be diff -up nfs-utils-1.0.9/utils/mount/nfsmount.c.orig nfs-utils-1.0.9/utils/mount/nfsmount.c --- nfs-utils-1.0.9/utils/mount/nfsmount.c.orig 2009-05-01 09:03:23.733038000 -0700 +++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2009-05-01 09:05:14.003778000 -0700 @@ -704,6 +704,19 @@ parse_options(char *old_opts, struct nfs else strncpy(data->context, context, NFS_MAX_CONTEXT_LEN); + } else if (!strcmp(opt, "lookupcache")) { + char *lookupcache = opteq + 1; + if (!strcmp(lookupcache, "all")) { + data->flags &= ~(NFS_MOUNT_LOOKUP_CACHE_NONEG|NFS_MOUNT_LOOKUP_CACHE_NONE); + } else if (!strcmp(lookupcache, "pos") || !strcmp(lookupcache, "positive")) { + data->flags &= ~NFS_MOUNT_LOOKUP_CACHE_NONE; + data->flags |= NFS_MOUNT_LOOKUP_CACHE_NONEG; + } else if (!strcmp(lookupcache, "none")) { + data->flags |= NFS_MOUNT_LOOKUP_CACHE_NONEG|NFS_MOUNT_LOOKUP_CACHE_NONE; + } else if (!sloppy) { + printf(_("Warning: Unrecognized lookupcache option %s\n"), lookupcache); + goto bad_parameter; + } } else if (!sloppy) goto bad_parameter; sprintf(cbuf, "%s=%s,", opt, opteq+1); diff -up nfs-utils-1.0.9/utils/mount/nfs_mount.h.orig nfs-utils-1.0.9/utils/mount/nfs_mount.h --- nfs-utils-1.0.9/utils/mount/nfs_mount.h.orig 2009-05-01 09:03:23.736039000 -0700 +++ nfs-utils-1.0.9/utils/mount/nfs_mount.h 2009-05-01 09:05:14.008779000 -0700 @@ -65,7 +65,8 @@ struct nfs_mount_data { #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ #define NFS_MOUNT_NORDIRPLUS 0x8000 /* 5 */ #define NFS_MOUNT_UNSHARED 0x10000 /* 5 */ - +#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x20000 +#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x40000 /* security pseudoflavors */