+2006-03-08 Ion Badulescu <ionut@moisil.badula.org>
+
+ * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid
+ comparison was failing.
+
2006-03-08 Erez Zadok <ezk@cs.sunysb.edu>
* configure.in: properly test for either <gdbm/ndbm.h> or
- Bugs fixed:
* correctly print nfs_args->addr info (sin_family/port/addr)
* pawd should resolve path repeatedly until no more to do
+ * handle old-style filehandles correctly (for mount points longer
+ than 28 chars)
*** Notes specific to am-utils version 6.2a1
union {
struct {
int fhh_type; /* old or new am_fh */
- int fhh_pid; /* process id */
+ pid_t fhh_pid; /* process id */
int fhh_id; /* map id */
} s;
char fhh_path[NFS_FHSIZE-sizeof(u_int)]; /* path to am_node */
ap = path_to_exported_ap(path);
XFREE(path);
} else {
- /* dlog("fh_to_mp3: old filehandle: %d", fp->fhh_id); */
+ /* dlog("fh_to_mp3: old filehandle: %d", fp->u.s.fhh_id); */
/*
* Check process id matches
* If it doesn't then it is probably
* from an old kernel-cached filehandle
* which is now out of date.
*/
- if (fp->u.s.fhh_pid != am_mypid)
+ if (fp->u.s.fhh_pid != get_server_pid()) {
+ dlog("fh_to_mp3: wrong pid %d != my pid %ld", fp->u.s.fhh_pid, get_server_pid());
goto drop;
+ }
/*
* Get hold of the supposed mount node
/*
* Take the process id
*/
- fp->u.s.fhh_pid = am_mypid;
+ fp->u.s.fhh_pid = get_server_pid();
/*
* ... the map number
* or if we are unlucky enough to be given the same
* pid as a previous amd (very unlikely).
*/
- /* dlog("mp_to_fh: old filehandle: %d", fp->fhh_id); */
+ /* dlog("mp_to_fh: old filehandle: %d", fp->u.s.fhh_id); */
}
}