]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-namei-dec-drop-lock-20060612
authorDerrick Brashear <shadow@dementia.org>
Tue, 13 Jun 2006 01:01:51 +0000 (01:01 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 13 Jun 2006 01:01:51 +0000 (01:01 +0000)
FIXES 17638

unsure why yet, or even if, but this is all that makes sense

(cherry picked from commit 1e5f6a17fcf4f7039bae756c22735b77a31ceec5)

src/vol/namei_ops.c

index 3bd3fd7d2e50c205cafc95149095044995d4c825..a963cbadafed3d985903a25c0eb7fa66d2d61ef6 100644 (file)
@@ -695,16 +695,24 @@ namei_dec(IHandle_t * ih, Inode ino, int p1)
                FDH_REALLYCLOSE(fdP);
                return -1;
            }
+       } else {
+           IHandle_t *th;
+           IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
+           Log("Warning: Lost ref on ihandle dev %d vid %d ino %lld\n",
+               th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
+           IH_RELEASE(th);
+         
+           /* If we're less than 0, someone presumably unlinked;
+              don't bother setting count to 0, but we need to drop a lock */
+           if (namei_SetLinkCount(fdP, ino, 0, 1) < 0) {
+               FDH_REALLYCLOSE(fdP);
+               return -1;
+           }
        }
        if (count == 0) {
            IHandle_t *th;
            IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
-#if 0
-           /* This triggers in the fileserver on the volume index vnodes */
-           if (th->ih_refcnt > 1)
-               Log("Warning: Leaked ref on ihandle dev %d vid %d ino %lld\n",
-                   th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
-#endif
+
            namei_HandleToName(&name, th);
            IH_RELEASE(th);
            code = unlink(name.n_path);