From 82865811e49aae8b7b8ff9f5d995dc32518b9eb8 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 7 Jun 2012 13:54:20 -0400 Subject: [PATCH] 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 --- src/afs/afs_pioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 1.9.4