]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libafs: avoid flushing already freed dcaches in flush volumes
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 7 Jun 2012 17:54:20 +0000 (13:54 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 30 Aug 2013 10:02:13 +0000 (03:02 -0700)
When flushing volume data, skip flushing dcache entries which
are already freed.

Reviewed-on: http://gerrit.openafs.org/7539
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 82865811e49aae8b7b8ff9f5d995dc32518b9eb8)

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

index fdd8c0255c62e0b387cbe4fabdf4faa6425c1509..9f0ed44543ec7ff9e65f954a1d96c7db86887fbc 100644 (file)
@@ -3497,12 +3497,14 @@ DECL_PIOCTL(PFlushVolumeData)
        if (tdc->refCount <= 1) {    /* too high, in use by running sys call */
            ReleaseReadLock(&tdc->tlock);
            if (tdc->f.fid.Fid.Volume == volume && tdc->f.fid.Cell == cell) {
-               if (!(afs_indexFlags[i] & IFDataMod)) {
+               if (!(afs_indexFlags[i] & (IFDataMod | IFFree | IFDiscarded))) {
                    /* if the file is modified, but has a ref cnt of only 1,
                     * then someone probably has the file open and is writing
                     * into it. Better to skip flushing such a file, it will be
                     * brought back immediately on the next write anyway.
                     *
+                    * Skip if already freed.
+                    *
                     * If we *must* flush, then this code has to be rearranged
                     * to call afs_storeAllSegments() first */
                    afs_FlushDCache(tdc);