]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount.nfs - nordirplus option
authorSteve Dickson <steved@redhat.com>
Thu, 29 Mar 2007 03:08:06 +0000 (13:08 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 29 Mar 2007 03:08:06 +0000 (13:08 +1000)
From: Steve Dickson <steved@redhat.com>

Adds the -o nordirplus mount option that will disable
NFS clients from using the READDIRPLUS RPC.

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
utils/mount/nfs.man
utils/mount/nfs_mount.h
utils/mount/nfsmount.c

index 8abdb8394ead612b2597fc3cf067d42a448df48d..673556ca6c37a6b6baf33b1200645a08c1240ada 100644 (file)
@@ -283,6 +283,11 @@ support UDP.
 .TP 1.5i
 .I udp
 Mount the NFS filesystem using the UDP protocol.
+.TP 1.5i
+.I nordirplus
+Disables NFSv3 READDIRPLUS RPCs. Use this option when
+mounting servers that don't support or have broken
+READDIRPLUS implementations.
 .P
 All of the non-value options have corresponding nooption forms.
 For example, nointr means don't allow file operations to be
index a8d1f1ad6edbf9a2daa5cd3f85dab3c34d55474b..4a061d834f4f20081bd7447d0948e22bcfcbe440 100644 (file)
@@ -63,6 +63,7 @@ struct nfs_mount_data {
 #define NFS_MOUNT_BROKEN_SUID  0x0400  /* 4 */
 #define NFS_MOUNT_NOACL     0x0800  /* 4 */
 #define NFS_MOUNT_SECFLAVOUR   0x2000  /* 5 */
+#define NFS_MOUNT_NORDIRPLUS   0x4000  /* 5 */
 
 /* security pseudoflavors */
 
index 776ef6440a78acf67effed85e0a3789a0dccdf6a..815064a593e4ad917fe18a09124e6d0ee7e53c62 100644 (file)
@@ -800,6 +800,10 @@ parse_options(char *old_opts, struct nfs_mount_data *data,
                                data->flags &= ~NFS_MOUNT_NOACL;
                                if (!val)
                                        data->flags |= NFS_MOUNT_NOACL;
+                       } else if (!strcmp(opt, "rdirplus")) {
+                               data->flags &= ~NFS_MOUNT_NORDIRPLUS;
+                               if (!val)
+                                       data->flags |= NFS_MOUNT_NORDIRPLUS;
 #endif
                        } else {
                        bad_option:
@@ -983,6 +987,7 @@ nfsmount(const char *spec, const char *node, int *flags,
 #endif
 #if NFS_MOUNT_VERSION >= 5
        printf("sec = %u ", data.pseudoflavor);
+       printf("readdirplus = %d ", (data.flags & NFS_MOUNT_NORDIRPLUS) != 0);
 #endif
        printf("\n");
 #endif