From fa70575af3dd5b8e1467dd516413b6d153a9963a Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 26 Apr 2010 16:41:29 -0400 Subject: [PATCH] allow file length to be updated unless we're writing right now, merely having the file open O_RDWR, or mapped, precludes a length update from being reflected. Change-Id: I7f732b053c392aa6cc1c8ad6de8e0f4bd6468728 Reviewed-on: http://gerrit.openafs.org/1841 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/afs_vcache.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 51566e77d..f5f9141d0 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -1464,18 +1464,15 @@ afs_SimpleVStat(register struct vcache *avc, afs_size_t length; AFS_STATCNT(afs_SimpleVStat); -#ifdef AFS_SGI_ENV - if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc) - && !AFS_VN_MAPPED((vnode_t *) avc)) { -#else - if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) { -#endif #ifdef AFS_64BIT_CLIENT FillInt64(length, astat->Length_hi, astat->Length); #else /* AFS_64BIT_CLIENT */ length = astat->Length; #endif /* AFS_64BIT_CLIENT */ + #if defined(AFS_SGI_ENV) + if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc) + && !AFS_VN_MAPPED((vnode_t *) avc)) { osi_Assert((valusema(&avc->vc_rwlock) <= 0) && (OSI_GET_LOCKID() == avc->vc_rwlockid)); if (length < avc->f.m.Length) { @@ -1488,8 +1485,11 @@ afs_SimpleVStat(register struct vcache *avc, AFS_GLOCK(); ObtainWriteLock(&avc->lock, 67); } + } #endif - /* if writing the file, don't fetch over this value */ + + if (!afs_DirtyPages(avc)) { + /* if actively writing the file, don't fetch over this value */ afs_Trace3(afs_iclSetp, CM_TRACE_SIMPLEVSTAT, ICL_TYPE_POINTER, avc, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length)); -- 2.39.5