lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] 9p: set page uptodate when required in write_end()
On Wed, Oct 11, 2017 at 12:27:43PM +0000, Levin, Alexander (Sasha Levin) wrote:
> >> 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);
> >> + }

Umm... I'm not sure I like it in that form. Look: to get here
we need to successfully pass through ->write_begin(). Which
means that we either have returned with PageUptodate(page) or
had hit len == PAGE_SIZE && !PageUptodate(page). Case of
non-uptodate with len < PAGE_SIZE is handled by forcing readpage
and repeating the entire thing.

So the only way to get !PageUptodate(page) in ->write_end() is
to have had len == PAGE_SIZE. It needs a comment, at the very
least.

\
 
 \ /
  Last update: 2017-10-11 18:47    [W:0.534 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site