From: Derrick Brashear Date: Fri, 14 Nov 2003 23:36:16 +0000 (+0000) Subject: namei-ihandle-leak-20031114 X-Git-Tag: openafs-devel-1_3_50~30 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=79b67c7461097ab5ca1dac9b9c1f069dfb4d290d namei-ihandle-leak-20031114 FIXES 2518 namei_dec now logs if you have open ihandles when you unlink a file ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== FIXES 2518 flush all dir buffers we have cached when rewriting a volume from a restore avoids holding an ihandle which has an open fdhandle for an unlinked file ==================== FIXES 2518 remove logging code for now. it appears to trigger on some possibly legitimate operations. --- diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 5319127..7a996a3 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -694,9 +694,16 @@ namei_dec(IHandle_t * ih, Inode ino, int p1) } } if (count == 0) { - IHandle_t th = *ih; - th.ih_ino = ino; - namei_HandleToName(&name, &th); + 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); } FDH_CLOSE(fdP); diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 481d184..a390e0d 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -1446,6 +1446,9 @@ VolRestore(acid, atrans, aflags, cookie) } strcpy(tt->lastProcName, "Restore"); tt->rxCallPtr = acid; + + DFlushVolume(V_parentId(tt->volume)); /* Ensure dir buffers get dropped */ + code = RestoreVolume(acid, tt->volume, (aflags & 1), cookie); /* last is incrementalp */ FSYNC_askfs(tt->volid, NULL, FSYNC_RESTOREVOLUME, 0l); /*break call backs on the * restored volume */