From: Derrick Brashear Date: Mon, 21 Nov 2011 17:06:59 +0000 (-0500) Subject: ihandle: don't keep reallyclosing future fds X-Git-Tag: upstream/1.6.6_pre2^2~98 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5640a55409fe88642b8b1ef55449052f22d65092;p=packages%2Fo%2Fopenafs.git ihandle: don't keep reallyclosing future fds given that we can mark something invalid for future use, ever, once we have done so for all fds, we ih_reallyclose is done. don't persist the setting to the detriment of new fds Reviewed-on: http://gerrit.openafs.org/6101 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear (cherry picked from commit 2332ee3aa8e21738ed4aa42b53edd4e2ae0a2984) Change-Id: Ic77354893101acda867aa8e4c8ea7a2932666d5b Reviewed-on: http://gerrit.openafs.org/9490 Reviewed-by: Derrick Brashear Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand Tested-by: BuildBot --- diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index f8db2cd15..e09b4cbb8 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -556,6 +556,20 @@ fd_reallyclose(FdHandle_t * fdP) */ if (!ihP->ih_fdhead) { ihP->ih_flags &= ~IH_REALLY_CLOSED; + } else { + FdHandle_t *lfdP, *next; + int clear = 1; + for (lfdP = ihP->ih_fdhead; lfdP != NULL; lfdP = next) { + next = lfdP->fd_ihnext; + osi_Assert(lfdP->fd_ih == ihP); + if (lfdP->fd_status != FD_HANDLE_CLOSING) { + clear = 0; + break; + } + } + /* no *future* fd should be subjected to this */ + if (clear) + ihP->ih_flags &= ~IH_REALLY_CLOSED; } if (fdP->fd_refcnt == 0) {