Skip to content

Commit

Permalink
9p: set page uptodate when required in write_end()
Browse files Browse the repository at this point in the history
Commit 77469c3 prevented setting the page as uptodate when we wrote
the right amount of data, fix that.

Fixes: 77469c3 ("9p: saner ->write_end() on failing copy into non-uptodate page")
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Alexander Levin <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexander Levin authored and torvalds committed Oct 11, 2017
1 parent a0db289 commit 56ae414
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/9p/vfs_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56ae414

Please sign in to comment.