#else
afs_FakeOpen(avc);
#endif
- avc->f.states |= CDirty;
while (totalLength > 0) {
+ /*
+ * Note that we must set CDirty for every iteration of this loop.
+ * CDirty may get cleared below (such as during afs_DoPartialStore),
+ * but we're still writing to the file, so make sure CDirty is set
+ * here.
+ */
+ avc->f.states |= CDirty;
+
tdc = afs_ObtainDCacheForWriting(avc, filePos, totalLength, treq,
noLock);
if (!tdc) {