From: Ion Badulescu Date: Thu, 9 Mar 2006 03:11:21 +0000 (+0000) Subject: * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid X-Git-Tag: am-utils-6_2a2~20 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=dec1823821a9e61d3b75a7faddd9f5d85eebb843;p=am-utils-6.0.git * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid comparison was failing. --- diff --git a/ChangeLog b/ChangeLog index a41f6b1..3bbd5e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-08 Ion Badulescu + + * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid + comparison was failing. + 2006-03-08 Erez Zadok * configure.in: properly test for either or diff --git a/NEWS b/NEWS index e7f661c..9d878be 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ shortname, user=N, group=N, mask=N, and dirmask=N. - 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 diff --git a/amd/nfs_subr.c b/amd/nfs_subr.c index c67aca9..80c52d1 100644 --- a/amd/nfs_subr.c +++ b/amd/nfs_subr.c @@ -71,7 +71,7 @@ struct am_fh { 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 */ @@ -650,15 +650,17 @@ fh_to_mp3(am_nfs_fh *fhp, int *rp, int vop) 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 @@ -807,7 +809,7 @@ mp_to_fh(am_node *mp, am_nfs_fh *fhp) /* * Take the process id */ - fp->u.s.fhh_pid = am_mypid; + fp->u.s.fhh_pid = get_server_pid(); /* * ... the map number @@ -821,6 +823,6 @@ mp_to_fh(am_node *mp, am_nfs_fh *fhp) * 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); */ } }