From: Michael Meffie Date: Thu, 7 Jun 2012 17:54:20 +0000 (-0400) Subject: libafs: avoid flushing already freed dcaches in flush volumes X-Git-Tag: openafs-stable-1_8_0pre1~2179 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=82865811e49aae8b7b8ff9f5d995dc32518b9eb8 libafs: avoid flushing already freed dcaches in flush volumes When flushing volume data, skip flushing dcache entries which are already freed. Change-Id: I74d7e055e833dc91214dd9d544af3781f74db59b Reviewed-on: http://gerrit.openafs.org/7539 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 6283a59..aab52ff 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -3544,12 +3544,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);