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.8.0_pre1^2~2111 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2332ee3aa8e21738ed4aa42b53edd4e2ae0a2984;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 Change-Id: If82368dad79841a5d68f45a608b2645b32f951e7 Reviewed-on: http://gerrit.openafs.org/6101 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index 90fd2adeb..a9608c9f1 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -508,6 +508,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) {