From 1e5f6a17fcf4f7039bae756c22735b77a31ceec5 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 13 Jun 2006 00:58:33 +0000 Subject: [PATCH] namei-dec-drop-lock-20060612 FIXES 17638 unsure why yet, or even if, but this is all that makes sense --- src/vol/namei_ops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 3bd3fd7d2..a963cbada 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -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); -- 2.39.5