Skip to contentSkip to conversation

Set PG_uptodate in nfs_writepage_sync()

PATCH New Trond Myklebust 1 participant 1 message Jul 28, 2002 NFS client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set PG_uptodate in nfs_writepage_sync()

A patch by Charles Lever ([email protected]) that ensures the PG_uptodate bit gets set if an entire page gets written by nfs_writepage_sync().

fs/nfs/write.c +9 -2
diff -u --recursive --new-file linux-2.5.29/fs/nfs/write.c linux-2.5.29-noac/fs/nfs/write.c
@@ -808,8 +808,15 @@
 	 * If wsize is smaller than page size, update and write
 	 * page synchronously.
 	 */
-	if (NFS_SERVER(inode)->wsize < PAGE_CACHE_SIZE || IS_SYNC(inode))
-		return nfs_writepage_sync(file, inode, page, offset, count);
+	if (NFS_SERVER(inode)->wsize < PAGE_CACHE_SIZE || IS_SYNC(inode)) {
+		status = nfs_writepage_sync(file, inode, page, offset, count);
+		if (status > 0) {
+			if (offset == 0 && status == PAGE_CACHE_SIZE)
+				SetPageUptodate(page);
+			return 0;
+		}
+		return status;
+	}
 
 	/*
 	 * Try to find an NFS request corresponding to this page