]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
ihandle: don't keep reallyclosing future fds
authorDerrick Brashear <shadow@dementix.org>
Mon, 21 Nov 2011 17:06:59 +0000 (12:06 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Sep 2013 20:29:29 +0000 (13:29 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 2332ee3aa8e21738ed4aa42b53edd4e2ae0a2984)

Change-Id: Ic77354893101acda867aa8e4c8ea7a2932666d5b
Reviewed-on: http://gerrit.openafs.org/9490
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/vol/ihandle.c

index f8db2cd152bcf0f031273ae500f0339ea0e3b7bd..e09b4cbb87b16d0442399d1e19314314be72eabc 100644 (file)
@@ -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) {