]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Apply STABLE14-background-fsync-consistency-issues-20090522
authorRuss Allbery <rra@debian.org>
Tue, 26 May 2009 23:54:05 +0000 (16:54 -0700)
committerRuss Allbery <rra@debian.org>
Tue, 26 May 2009 23:54:05 +0000 (16:54 -0700)
* Apply upstream CVS deltas:
  - STABLE14-background-fsync-consistency-issues-20090522: file
    descriptor handling fixes for the file server.

debian/changelog
src/vol/ihandle.c
src/vol/vnode.c

index 700633d5763a3b0acd9176997e2a4a5918ea12f4..c78d2808b6b227dc5a00e1d1b92b7a7f33a04291 100644 (file)
@@ -11,6 +11,8 @@ openafs (1.4.10+dfsg1-2) UNRELEASED; urgency=low
       flag setting and locking around recursive mmap protection.
     - STABLE14-memcache-write-on-laststore-20090512: write back dirty
       pages on last store with memcache to avoid losing changes.
+    - STABLE14-background-fsync-consistency-issues-20090522: file
+      descriptor handling fixes for the file server.
   * Provide an openafs-modules-dkms package that uses DKMS to dynamically
     build kernel modules for the local kernel and document this option in
     README.modules.  This is an alternative to installing
index c3ae3ce19b6080a261f68ab08dc007b909da2720..80c00f71c608746ba2ceae48e4209343d6696584 100644 (file)
@@ -15,7 +15,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18.2.6 2008/10/27 23:54:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18.2.7 2009/05/22 16:00:46 shadow Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -803,10 +803,32 @@ ih_reallyclose(IHandle_t * ihP)
        return 0;
 
     IH_LOCK;
+    ihP->ih_refcnt++;   /* must not disappear over unlock */
+    if (ihP->ih_synced) {
+       FdHandle_t *fdP;
+       IH_UNLOCK;
+       
+       fdP = IH_OPEN(ihP);
+       if (fdP) { 
+           OS_SYNC(fdP->fd_fd);
+           FDH_CLOSE(fdP);
+       }
+       
+       IH_LOCK;
+    }
+
     assert(ihP->ih_refcnt > 0);
+    ihP->ih_synced = 0;
+
     ih_fdclose(ihP);
 
-    IH_UNLOCK;
+    if (ihP->ih_refcnt > 1) {
+       ihP->ih_refcnt--;
+       IH_UNLOCK;
+    } else {
+       IH_UNLOCK;
+       ih_release(ihP);
+    }
     return 0;
 }
 
@@ -884,8 +906,10 @@ ih_sync_all() {
                IH_UNLOCK;
 
                fdP = IH_OPEN(ihP);
-               if (fdP) OS_SYNC(fdP->fd_fd);
-               FDH_CLOSE(fdP);
+               if (fdP) { 
+                   OS_SYNC(fdP->fd_fd);
+                   FDH_CLOSE(fdP);
+               }
 
                IH_LOCK;
            }
index 643b0f7e536b2ad2f9fff759dd3f5c03e0bdc1c2..e5ad07f8d8f17ffa4cf39c20c3610aa872be6a56 100644 (file)
@@ -17,7 +17,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19.2.7 2009/02/17 04:37:59 shadow Exp $");
+    ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19.2.8 2009/05/22 16:00:46 shadow Exp $");
 
 #include <errno.h>
 #include <stdio.h>
@@ -959,7 +959,6 @@ VCloseVnodeFiles_r(Volume * vp)
        for (vnp = VnodeHashTable[i]; vnp; vnp = vnp->hashNext) {
            if (vnp->volumePtr == vp) {
                IH_REALLYCLOSE(vnp->handle);
-               IH_RELEASE(vnp->handle);
            }
        }
     }