Skip to contentSkip to conversation

nfs_updatepage must not extend the write

PATCH New Jiang Guiqing 1 participant 1 message Mar 10, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs_updatepage must not extend the write

hi,all

I think, when mounting nfs with sync option, nfs_updatepage must not extend the write to cover the entire page.

---
 linux-2.6.25-rc4/fs/nfs/write.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
linux-2.6.25-rc4/fs/nfs/write.c +2 -1
index 80c61fd..94d6aaf 100644
@@ -734,7 +734,8 @@ int nfs_updatepage(struct file *file, struct page *page,
 	 */
 	if (nfs_write_pageuptodate(page, inode) &&
 			inode->i_flock == NULL &&
-			!(file->f_flags & O_SYNC)) {
+			!(file->f_flags & O_SYNC) &&
+			!(IS_SYNC(inode))) {
 		count = max(count + offset, nfs_page_length(page));
 		offset = 0;
 	}
Signature · 4 lines
1.5.3.8

Thanks.
-Jiang Guiqing