[PATCH] Set PG_uptodate in nfs_writepage_sync()

Trond Myklebust (trond.myklebust@fys.uio.no)
Sun, 28 Jul 2002 17:24:00 +0200


A patch by Charles Lever (Charles.Lever@netapp.com) that ensures the
PG_uptodate bit gets set if an entire page gets written by
nfs_writepage_sync().

diff -u --recursive --new-file linux-2.5.29/fs/nfs/write.c linux-2.5.29-noac/fs/nfs/write.c
--- linux-2.5.29/fs/nfs/write.c Thu Jul 4 18:17:16 2002
+++ linux-2.5.29-noac/fs/nfs/write.c Sat Jul 27 17:28:29 2002
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/