Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655857

Re: [PATCH] 9p: set page uptodate when required in write_end()

From "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Newsgroups linux.kernel
Subject Re: [PATCH] 9p: set page uptodate when required in write_end()
Date 2017-06-02 04:40 +0200
Message-ID <tNKFj-30G-1@gated-at.bofh.it> (permalink)
References <tuMxX-4vz-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ping?

On Mon, Apr 10, 2017 at 02:46:57PM -0400, Sasha Levin wrote:
> From: Alexander Levin <alexander.levin@verizon.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@suse.com>
> Signed-off-by: Alexander Levin <alexander.levin@verizon.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

-- 

Thanks,
Sasha

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] 9p: set page uptodate when required in write_end() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-02 04:40 +0200

csiph-web