avc->states |= CDirty;
code = afs_TruncateAllSegments(avc, tsize, &treq, acred);
+#ifdef AFS_LINUX_26_ENV
+ /* We must update the Linux kernel's idea of file size as soon as
+ * possible, to avoid racing with delayed writepages delivered by
+ * pdflush */
+ if (code == 0)
+ i_size_write(AFSTOV(avc), tsize);
+#endif
/* if date not explicitly set by this call, set it ourselves, since we
* changed the data */
if (!(astat.Mask & AFS_SETMODTIME)) {