[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170410184657.13430-1-alexander.levin@verizon.com>
Date: Mon, 10 Apr 2017 18:46:51 +0000
From: alexander.levin@...izon.com
To: "ericvh@...il.com" <ericvh@...il.com>,
"rminnich@...dia.gov" <rminnich@...dia.gov>,
"lucho@...kov.net" <lucho@...kov.net>
Cc: "v9fs-developer@...ts.sourceforge.net"
<v9fs-developer@...ts.sourceforge.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jack@...e.com" <jack@...e.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
alexander.levin@...izon.com
Subject: [PATCH] 9p: set page uptodate when required in write_end()
From: Alexander Levin <alexander.levin@...izon.com>
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@...e.com>
Signed-off-by: Alexander Levin <alexander.levin@...izon.com>
---
fs/9p/vfs_addr.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index adaf6f6..e1cbdfd 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,
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
--
2.7.4
Powered by blists - more mailing lists