Right now AMD sets all timeout values to their defaults
authorChristos Zoulas <christos@zoulas.com>
Thu, 10 Dec 2009 17:49:28 +0000 (12:49 -0500)
committerChristos Zoulas <christos@zoulas.com>
Thu, 10 Dec 2009 17:49:28 +0000 (12:49 -0500)
even if you explicitly set them to zero. This patch
introduces separate flags that store if the respective
values have been set and the code path setting default
values checks these flags instead of testing the values
for zero. [Linux only]
From: Krisztian Kovacs <Kris.Kovacs@morganstanley.com>

ChangeLog
conf/mount/mount_linux.c
conf/nfs_prot/nfs_prot_linux.h

index d466e0f99c37c0f31657d1021193e9a87d8a5dfe..580f1de28456678afdf60b9f195132de4849c1f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-12-10  Christos Zoulas <christos@zoulas.com>
 
+       * Right now AMD sets all timeout values to their defaults
+         even if you explicitly set them to zero. This patch
+         introduces separate flags that store if the respective
+         values have been set and the code path setting default
+         values checks these flags instead of testing the values
+         for zero. [Linux only]
+         From: Krisztian Kovacs <Kris.Kovacs@morganstanley.com>
+
        * Fix mntfs related lookup/(un)mount race conditions, by
          introducing a new structure linking an mntfs to a node.
          From: Krisztian Kovacs <Kris.Kovacs@morganstanley.com>
index e7e1c6e2057c50b9d5589b007b4384197e7ecb9b..098045422a3abbc6a82ac44952df71143891bc3f 100644 (file)
@@ -291,13 +291,13 @@ mount_linux_nfs(MTYPE_TYPE type, mntent_t *mnt, int flags, caddr_t data)
 
 #ifdef MNT2_NFS_OPT_NOAC
   if (!(mnt_data->flags & MNT2_NFS_OPT_NOAC)) {
-    if (!mnt_data->acregmin)
+    if (!(mnt_data->flags & MNT2_NFS_OPT_ACREGMIN))
       mnt_data->acregmin = 3;
-    if (!mnt_data->acregmax)
+    if (!(mnt_data->flags & MNT2_NFS_OPT_ACREGMAX))
       mnt_data->acregmax = 60;
-    if (!mnt_data->acdirmin)
+    if (!(mnt_data->flags & MNT2_NFS_OPT_ACDIRMIN))
       mnt_data->acdirmin = 30;
-    if (!mnt_data->acdirmax)
+    if (!(mnt_data->flags & MNT2_NFS_OPT_ACDIRMAX))
       mnt_data->acdirmax = 60;
   }
 #endif /* MNT2_NFS_OPT_NOAC */
@@ -373,6 +373,8 @@ mount_linux_nfs(MTYPE_TYPE type, mntent_t *mnt, int flags, caddr_t data)
     print_nfs_args(mnt_data, 0);
   }
 
+  mnt_data->flags &= MNT2_NFS_OPT_FLAGMASK;
+
   errorcode = do_mount_linux(type, mnt, flags, data);
 
  out:
index 1c6876dcf7c1c4673698a1ef391559c03e365db7..a1ab3cabed8c4cc7bd30ef7b6743297e62396ddd 100644 (file)
@@ -264,6 +264,18 @@ struct nfs_args {
 };
 typedef struct nfs_args nfs_args_t;
 
+/* HACK: these are not defined on Linux but we still need them
+ * internally.  We have to be able to differentiate between having a
+ * timeout value set to zero and not having the option at all. These
+ * flags are masked off before passing the nfs_args structure to
+ * mount2() */
+
+#define MNT2_NFS_OPT_ACREGMIN 0x10000
+#define MNT2_NFS_OPT_ACREGMAX 0x20000
+#define MNT2_NFS_OPT_ACDIRMIN 0x40000
+#define MNT2_NFS_OPT_ACDIRMAX 0x80000
+#define MNT2_NFS_OPT_FLAGMASK 0xFFFF
+
 /*
  * Missing definitions on redhat alpha linux
  */