aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Levin <alexander.levin@verizon.com>2017-04-10 14:46:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-11 12:30:08 -0400
commit56ae414e9d2718bcbfda9ba3797c39005e2f90fb (patch)
tree377636c4a2fa3a6a52e8a04fa88e828ffe5bccea
parenta0db28909ecfcb9e581f567f688929ed38ef3f56 (diff)
9p: set page uptodate when required in write_end()
Commit 77469c3f570 prevented setting the page as uptodate when we wrote the right amount of data, fix that. Fixes: 77469c3f570 ("9p: saner ->write_end() on failing copy into non-uptodate page") Reviewed-by: Jan Kara <jack@suse.com> Signed-off-by: Alexander Levin <alexander.levin@verizon.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/9p/vfs_addr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index adaf6f6dd858..e1cbdfdb7c68 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -310,9 +310,13 @@ static int v9fs_write_end(struct file *filp, struct address_space *mapping,
310 310
311 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); 311 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping);
312 312
313 if (unlikely(copied < len && !PageUptodate(page))) { 313 if (!PageUptodate(page)) {
314 copied = 0; 314 if (unlikely(copied < len)) {
315 goto out; 315 copied = 0;
316 goto out;
317 } else if (len == PAGE_SIZE) {
318 SetPageUptodate(page);
319 }
316 } 320 }
317 /* 321 /*
318 * No need to use i_size_read() here, the i_size 322 * No need to use i_size_read() here, the i_size