right now, flock with LOCK_EX, on unlock, triggers an async store.
make it sync, but also, make sure to ask to have any in-memory
data sent to us (e.g. VM_StoreAllSegments); unlike Solaris
VMSYNC_INVAL, we don't want to invalidate the pages, just get copies
written back.
LOCK_SH did not, does not and AFAICT should not trigger writes.
Change-Id: Id4a72f73b685b5566bb31f6f610f22d806899280
Reviewed-on: http://gerrit.openafs.org/1846
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
}
}
} else if (avc->flockCount == -1) {
- afs_StoreAllSegments(avc, areq, AFS_ASYNC); /* fsync file early */
+ afs_StoreAllSegments(avc, areq, AFS_SYNC | AFS_VMSYNC); /* fsync file early */
avc->flockCount = 0;
/* And remove the (only) exclusive lock entry from the list... */
osi_FreeSmallSpace(avc->slocks);
#define AFS_SYNC 1
#define AFS_VMSYNC_INVAL 2 /* sync and invalidate pages */
#define AFS_LASTSTORE 4
-
+#define AFS_VMSYNC 8 /* sync pages but do not invalidate */
/* background request structure */
#define BPARMS 4
* on the memcache case since that's we adjust the file's size
* and finish flushing partial vm pages.
*/
- if ((cacheDiskType != AFS_FCACHE_TYPE_MEM) || (sync & AFS_LASTSTORE))
+ if ((cacheDiskType != AFS_FCACHE_TYPE_MEM) ||
+ (sync & AFS_VMSYNC_INVAL) || (sync & AFS_VMSYNC) ||
+ (sync & AFS_LASTSTORE))
#endif /* !AFS_AIX32_ENV && !AFS_SGI65_ENV */
{
/* If we're not diskless, reading a file may stress the VM