disconnected-refcount-fixes-20081130
authorDragos Tatulea <dragos.tatulea@gmail.com>
Sun, 30 Nov 2008 20:11:05 +0000 (20:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 30 Nov 2008 20:11:05 +0000 (20:11 +0000)
LICENSE IPL10
FIXES 123714

fix code which tweaks refcounts on disconnected vcaches to be correct

src/afs/VNOPS/afs_vnop_rename.c
src/afs/afs_disconnected.c

index cb7a3f0..13ced95 100644 (file)
@@ -246,6 +246,8 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp,
                    tvc->ddirty_flags |= VDisconRenameSameDir;
                ReleaseWriteLock(&tvc->lock);
            }                   /* if not previously renamed */
+
+           afs_PutVCache(tvc);
        } else {
            code = ENOENT;
        }                       /* if (tvc) */
index aeeaaa3..5579a07 100644 (file)
@@ -322,8 +322,10 @@ int chk_del_children_hook(void *hdata,
     /* Count unfinished dirty children. VDisconShadowed can still be set,
      * because we need it to remove the shadow dir.
      */
-    if (tvc && tvc->ddirty_flags) {
-       v->count++;
+    if (tvc) {
+       if (tvc->ddirty_flags)
+           v->count++;
+
        afs_PutVCache(tvc);
     }