Merge tag 'phy-for-4.14-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon...
[platform/kernel/linux-starfive.git] / fs / 9p / vfs_addr.c
index adaf6f6..e1cbdfd 100644 (file)
@@ -310,9 +310,13 @@ static int v9fs_write_end(struct file *filp, struct address_space *mapping,
 
        p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping);
 
-       if (unlikely(copied < len && !PageUptodate(page))) {
-               copied = 0;
-               goto out;
+       if (!PageUptodate(page)) {
+               if (unlikely(copied < len)) {
+                       copied = 0;
+                       goto out;
+               } else if (len == PAGE_SIZE) {
+                       SetPageUptodate(page);
+               }
        }
        /*
         * No need to use i_size_read() here, the i_size