* amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid
authorIon Badulescu <ib42@cs.columbia.edu>
Thu, 9 Mar 2006 03:11:21 +0000 (03:11 +0000)
committerIon Badulescu <ib42@cs.columbia.edu>
Thu, 9 Mar 2006 03:11:21 +0000 (03:11 +0000)
comparison was failing.

ChangeLog
NEWS
amd/nfs_subr.c

index a41f6b1b85828b78fe0dda371fdf18c6a0df16ce..3bbd5e52fb93c5eaee6c1c6783f5f8edc1a05391 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/NEWS b/NEWS
index e7f661c38af586b17ff2aaa88d771bf891abbf17..9d878be191ceea33bbc9d5723330c5e586724e24 100644 (file)
--- 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
 
index c67aca9f2d50dfcee43934107c65795da744e7ba..80c52d181ff797ed4b92d7bee3ec4699df6cd79c 100644 (file)
@@ -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); */
   }
 }