提交 56ae414e 编写于 作者: A Alexander Levin 提交者: Linus Torvalds

9p: set page uptodate when required in write_end()

Commit 77469c3f prevented setting the page as uptodate when we wrote
the right amount of data, fix that.

Fixes: 77469c3f ("9p: saner ->write_end() on failing copy into non-uptodate page")
Reviewed-by: NJan Kara <jack@suse.com>
Signed-off-by: NAlexander Levin <alexander.levin@verizon.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a0db2890
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册