All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Yan, Zheng" <zyan@redhat.com>, ceph-devel@vger.kernel.org
Cc: dan.carpenter@oracle.com
Subject: Re: [PATCH 3/3] ceph: cleanup writepage_nounlock()
Date: Tue, 23 May 2017 06:36:04 -0400	[thread overview]
Message-ID: <1495535764.2946.3.camel@redhat.com> (raw)
In-Reply-To: <20170523095439.63347-3-zyan@redhat.com>

On Tue, 2017-05-23 at 17:54 +0800, Yan, Zheng wrote:
> Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> ---
>  fs/ceph/addr.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 1880125..777acee 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -530,7 +530,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  	long writeback_stat;
>  	u64 truncate_size;
>  	u32 truncate_seq;
> -	int err = 0, len = PAGE_SIZE;
> +	int err, len = PAGE_SIZE;
>  
>  	dout("writepage %p idx %lu\n", page, page->index);
>  
> @@ -543,7 +543,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  	snapc = page_snap_context(page);
>  	if (snapc == NULL) {
>  		dout("writepage %p page %p not dirty?\n", inode, page);
> -		goto out;
> +		return 0;
>  	}
>  	oldest = get_oldest_context(inode, &snap_size,
>  				    &truncate_size, &truncate_seq);
> @@ -554,7 +554,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  		WARN_ON(!(current->flags & PF_MEMALLOC));
>  		ceph_put_snap_context(oldest);
>  		redirty_page_for_writepage(wbc, page);
> -		goto out;
> +		return 0;
>  	}
>  	ceph_put_snap_context(oldest);
>  
> @@ -564,8 +564,9 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  	/* is this a partial page at end of file? */
>  	if (page_off >= snap_size) {
>  		dout("%p page eof %llu\n", page, snap_size);
> -		goto out;
> +		return 0;
>  	}
> +
>  	if (snap_size < page_off + len)
>  		len = snap_size - page_off;
>  
> @@ -592,7 +593,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  			dout("writepage interrupted page %p\n", page);
>  			redirty_page_for_writepage(wbc, page);
>  			end_page_writeback(page);
> -			goto out;
> +			return err;
>  		}
>  		dout("writepage setting page/mapping error %d %p\n",
>  		     err, page);
> @@ -608,7 +609,6 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
>  	end_page_writeback(page);
>  	ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
>  	ceph_put_snap_context(snapc);  /* page's reference */
> -out:
>  	return err;
>  }
>  

Looks correct:

Reviewed-by: Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2017-05-23 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  9:54 [PATCH 1/3] ceph: remove useless page->mapping check in writepage_nounlock() Yan, Zheng
2017-05-23  9:54 ` [PATCH 2/3] ceph: redirty page when writepage_nounlock() skips unwritable page Yan, Zheng
2017-05-23 10:33   ` Jeff Layton
2017-05-23  9:54 ` [PATCH 3/3] ceph: cleanup writepage_nounlock() Yan, Zheng
2017-05-23 10:36   ` Jeff Layton [this message]
2017-05-23 10:31 ` [PATCH 1/3] ceph: remove useless page->mapping check in writepage_nounlock() Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495535764.2946.3.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.