in case.
(fh_to_mp3): increment amd_stats.d_stale counter only if we are
actually returning ESTALE.
* amd/info_exec.c (exec_parse_qanswer), amd/info_file.c
(file_search_or_reload), amd/info_hesiod.c (hesiod_search),
amd/info_ldap.c (amu_ldap_search), amd/info_ndbm.c (search_ndbm),
amd/info_nis.c (nis_search), amd/info_nisplus.c (nisplus_search,
nisplus_search): don't dereference mnt_map->cfm which may be null
if we're not using an amd.conf file.
* libamu/xutil.c (unregister_amq): if failed to de-register Amd
from portmapper, report it under dlog (debugging), not as an
annoying plog that always shows up.
+2005-09-15 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * amd/nfs_subr.c (nfsproc_getattr_2_svc): initialize 'retry', just
+ in case.
+ (fh_to_mp3): increment amd_stats.d_stale counter only if we are
+ actually returning ESTALE.
+
+ * amd/info_exec.c (exec_parse_qanswer), amd/info_file.c
+ (file_search_or_reload), amd/info_hesiod.c (hesiod_search),
+ amd/info_ldap.c (amu_ldap_search), amd/info_ndbm.c (search_ndbm),
+ amd/info_nis.c (nis_search), amd/info_nisplus.c (nisplus_search,
+ nisplus_search): don't dereference mnt_map->cfm which may be null
+ if we're not using an amd.conf file.
+
+2005-09-14 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * libamu/xutil.c (unregister_amq): if failed to de-register Amd
+ from portmapper, report it under dlog (debugging), not as an
+ annoying plog that always shows up.
+
2005-09-13 Erez Zadok <ezk@cs.sunysb.edu>
* mk-amd-map/mk-amd-map.c (read_file_file), libamu/util.c
*/
new_mp = get_ap_child(mp, expanded_fname);
XFREE(expanded_fname);
- if (new_mp == 0)
+ if (new_mp == NULL)
ereturn(ENOSPC);
*error_return = -1;
/*
* Return a copy of the data
*/
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX))
dc = sun_entry2amd(key, cp);
else
dc = strdup(cp);
* Return a copy of the data
*/
char *dc;
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)
+ /* if m->cfm == NULL, not using amd.conf file */
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX))
dc = sun_entry2amd(kp, cp);
else
dc = strdup(cp);
* it (and free subsequent replies)
*/
if (rvec && *rvec) {
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX) {
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)) {
*pval = sun_entry2amd(key, *rvec);
XFREE(*rvec);
} else
}
dlog("Map %s, %s => %s\n", map, key, vals[0]);
if (vals[0]) {
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX))
*pval = sun_entry2amd(key, vals[0]);
else
*pval = strdup(vals[0]);
k.dsize = strlen(key) + 1;
v = dbm_fetch(db, k);
if (v.dptr) {
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX))
*val = sun_entry2amd(key, v.dptr);
else
*val = strdup(v.dptr);
* Lookup key
*/
res = yp_match(gopt.nis_domain, map, key, strlen(key), pval, &outlen);
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX) {
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)) {
char *oldval = *pval;
*pval = sun_entry2amd(key, oldval);
XFREE(*pval); /* yp_match malloc's *pval above */
data.value = strnsave(ENTRY_VAL(value, 1), ENTRY_LEN(value, 1));
}
- if (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX) {
+ if (m->cfm && (m->cfm->cfm_flags & CFM_SUN_MAP_SYNTAX)) {
*val = sun_entry2amd(key, data.value);
XFREE(data.value); /* strnsave malloc'ed it above */
} else
if (mp->am_mnt->mf_ops->readlink) {
int retry = 0;
mp = (*mp->am_mnt->mf_ops->readlink) (mp, &retry);
- if (mp == 0) {
+ if (mp == NULL) {
*error_return = retry;
return 0;
}
{
static nfsattrstat res;
am_node *mp;
- int retry;
+ int retry = 0;
time_t now = clocktime();
if (amuDebug(D_TRACE))
plog(XLOG_DEBUG, "getattr:");
mp = fh_to_mp3(argp, &retry, VLOOK_CREATE);
- if (mp == 0) {
+ if (mp == NULL) {
if (amuDebug(D_TRACE))
plog(XLOG_DEBUG, "\tretry=%d", retry);
sprintf(opt_gid, "%d", (int) gid);
mp = fh_to_mp3(&argp->da_fhandle, &retry, VLOOK_CREATE);
- if (mp == 0) {
+ if (mp == NULL) {
if (retry < 0) {
amd_stats.d_drops++;
return 0;
plog(XLOG_DEBUG, "readlink:");
mp = fh_to_mp3(argp, &retry, VLOOK_CREATE);
- if (mp == 0) {
+ if (mp == NULL) {
readlink_retry:
if (retry < 0) {
amd_stats.d_drops++;
int retry;
am_node *mp = fh_to_mp3(&argp->da_fhandle, &retry, VLOOK_DELETE);
- if (mp == 0) {
+ if (mp == NULL) {
if (retry < 0) {
amd_stats.d_drops++;
return 0;
plog(XLOG_DEBUG, "\tremove(%s, %s)", mp->am_path, argp->da_name);
mp = mp->am_mnt->mf_ops->lookup_child(mp, argp->da_name, &retry, VLOOK_DELETE);
- if (mp == 0) {
+ if (mp == NULL) {
/*
* Ignore retries...
*/
plog(XLOG_DEBUG, "readdir:");
mp = fh_to_mp3(&argp->rda_fhandle, &retry, VLOOK_CREATE);
- if (mp == 0) {
+ if (mp == NULL) {
if (retry < 0) {
amd_stats.d_drops++;
return 0;
plog(XLOG_DEBUG, "statfs:");
mp = fh_to_mp3(argp, &retry, VLOOK_CREATE);
- if (mp == 0) {
+ if (mp == NULL) {
if (retry < 0) {
amd_stats.d_drops++;
return 0;
*/
if (amd_state == Finishing)
*rp = ENOENT;
- else
+ else {
*rp = ESTALE;
- amd_stats.d_stale++;
+ amd_stats.d_stale++;
+ }
}
return ap;
u_long amd_prognum = get_amd_program_number();
if (pmap_unset(amd_prognum, AMQ_VERSION) == 1)
- plog(XLOG_ERROR, "failed to de-register Amd program %lu, version %lu",
+ dlog("failed to de-register Amd program %lu, version %lu",
amd_prognum, AMQ_VERSION);
}
}