+2005-06-04 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * amd/ops_nfs.c (mount_nfs_fh): set timeo/retrans mount options
+ only if the user specified them in amd.conf or elsewhere. If they
+ were not specified, don't do anything, which would let the OS use
+ its own defaults.
+
+ * amd/get_args.c (get_args): negative timeo/retrans are "good" in
+ that they represent uninitialized values (meaning to let the OS
+ use it's default values). So only check if user specified a value
+ equal to zero (invalid).
+
+ * amd/amd.h: define AMU_TYPE_NONE so we know when users didn't
+ specify timeo/retrans at all.
+
2005-06-03 Erez Zadok <ezk@cs.sunysb.edu>
*******************************************************************
* SUCH DAMAGE.
*
*
- * $Id: get_args.c,v 1.31 2005/05/24 04:45:01 ezk Exp $
+ * $Id: get_args.c,v 1.32 2005/06/04 16:34:33 ezk Exp $
*
*/
/* sanity checking, normalize values just in case */
for (i=0; i<AMU_TYPE_MAX; ++i) {
- if (gopt.amfs_auto_timeo[i] <= 0)
+ if (gopt.amfs_auto_timeo[i] == 0)
gopt.amfs_auto_timeo[i] = AMFS_AUTO_TIMEO;
- if (gopt.amfs_auto_retrans[i] <= 0)
+ if (gopt.amfs_auto_retrans[i] == 0)
gopt.amfs_auto_retrans[i] = AMFS_AUTO_RETRANS(i);
- if (gopt.amfs_auto_retrans[i] <= 0)
- gopt.amfs_auto_retrans[i] = 3; /* XXX: needed? */
+ if (gopt.amfs_auto_retrans[i] == 0)
+ gopt.amfs_auto_retrans[i] = 3; /* under very unusual circumstances, could be zero */
}
}
* SUCH DAMAGE.
*
*
- * $Id: ops_nfs.c,v 1.42 2005/05/24 04:45:01 ezk Exp $
+ * $Id: ops_nfs.c,v 1.43 2005/06/04 16:34:33 ezk Exp $
*
*/
{
MTYPE_TYPE type;
char *colon;
- char *xopts=NULL, transp_opts[80];
+ char *xopts=NULL, transp_timeo_opts[40], transp_retrans_opts[40];
char host[MAXHOSTNAMELEN + MAXPATHLEN + 2];
fserver *fs = mf->mf_server;
u_long nfs_version = fs->fs_version;
int error;
int genflags;
int retry;
+ int proto = AMU_TYPE_NONE;
mntent_t mnt;
nfs_args_t nfs_args;
strcpy(host + MAXHOSTNAMELEN - 3, "..");
#endif /* MAXHOSTNAMELEN */
- /* create option=VAL for udp/tcp specific timeouts and retrans values */
- if (STREQ(nfs_proto, "udp")) {
- sprintf(transp_opts, "%s=%d,%s=%d,",
- MNTTAB_OPT_TIMEO, gopt.amfs_auto_timeo[AMU_TYPE_UDP],
- MNTTAB_OPT_RETRANS, gopt.amfs_auto_retrans[AMU_TYPE_UDP]);
- } else if (STREQ(nfs_proto, "tcp")) {
- sprintf(transp_opts, "%s=%d,%s=%d,",
- MNTTAB_OPT_TIMEO, gopt.amfs_auto_timeo[AMU_TYPE_TCP],
- MNTTAB_OPT_RETRANS, gopt.amfs_auto_retrans[AMU_TYPE_TCP]);
+ /*
+ * Create option=VAL for udp/tcp specific timeouts and retrans values, but
+ * only if these options were specified.
+ */
+
+ transp_timeo_opts[0] = transp_retrans_opts[0] = '\0'; /* initialize */
+ if (STREQ(nfs_proto, "udp"))
+ proto = AMU_TYPE_UDP;
+ else if (STREQ(nfs_proto, "tcp"))
+ proto = AMU_TYPE_TCP;
+ if (proto != AMU_TYPE_NONE) {
+ if (gopt.amfs_auto_timeo[proto] > 0)
+ sprintf(transp_timeo_opts, "%s=%d,",
+ MNTTAB_OPT_TIMEO, gopt.amfs_auto_timeo[proto]);
+ if (gopt.amfs_auto_retrans[proto] > 0)
+ sprintf(transp_retrans_opts, "%s=%d,",
+ MNTTAB_OPT_RETRANS, gopt.amfs_auto_retrans[proto]);
}
if (mf->mf_remopts && *mf->mf_remopts &&
!islocalnet(fs->fs_ip->sin_addr.s_addr)) {
plog(XLOG_INFO, "Using remopts=\"%s\"", mf->mf_remopts);
/* use transp_opts first, so map-specific opts will override */
- xopts = str3cat(xopts, transp_opts, mf->mf_remopts, "");
+ xopts = str3cat(xopts, transp_timeo_opts, transp_retrans_opts, mf->mf_remopts);
} else {
/* use transp_opts first, so map-specific opts will override */
- xopts = str3cat(xopts, transp_opts, mf->mf_mopts, "");
+ xopts = str3cat(xopts, transp_timeo_opts, transp_retrans_opts, mf->mf_mopts);
}
memset((voidp) &mnt, 0, sizeof(mnt));
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
-AC_INIT([am-utils],[6.1-rc7],[am-utils@am-utils.org])
+AC_INIT([am-utils],[6.1-rc8],[am-utils@am-utils.org])
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
dnl UPDATE LIBAMU VERSION BEFORE OFFICIAL RELEASE!!!
dnl
dnl AC_CONFIG_AUX_DIR(m4)
AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.93 $)
+AC_REVISION($Revision: 1.94 $)
AC_COPYRIGHT([Copyright (c) 1997-2005 Erez Zadok])
dnl find out system type
AC_MSG_NOTICE(*** SYSTEM TYPES ***)