All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Zhang Jingwang <zhangjingwang@nrchpc.ac.cn>
Cc: linux-nfs@vger.kernel.org, iisaman@citi.umich.edu
Subject: Re: [PATCH] pnfs: send layoutcommit until IO completed when return layout
Date: Wed, 12 May 2010 09:51:14 +0300	[thread overview]
Message-ID: <4BEA4FE2.9070409@panasas.com> (raw)
In-Reply-To: <20100511085943.GA6822@MDS-78.localdomain>

On May. 11, 2010, 11:59 +0300, Zhang Jingwang <zhangjingwang@nrchpc.ac.cn> wrote:
> If we call layoutcommit before IO completed, then some extents we are
> writing may not be in the commit list. When we return layout, they
> may not get a chance to be committed to server.
> 
> Signed-off-by: Zhang Jingwang <zhangjingwang@nrchpc.ac.cn>
> ---
>  fs/nfs/pnfs.c |   20 ++++++++++----------
>  1 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index 3739c38..6fa295b 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -726,16 +726,6 @@ _pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
>  		arg.length = ~0;
>  	}
>  	if (type == RETURN_FILE) {
> -		if (nfsi->layoutcommit_ctx) {
> -			status = pnfs_layoutcommit_inode(ino, 1);
> -			if (status) {
> -				dprintk("%s: layoutcommit failed, status=%d. "
> -					"Returning layout anyway\n",
> -					__func__, status);
> -				status = 0;
> -			}
> -		}
> -
>  		lo = get_lock_current_layout(nfsi);
>  		if (lo && !has_layout_to_return(lo, &arg)) {
>  			put_unlock_current_layout(lo);
> @@ -763,6 +753,16 @@ _pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
>  			wait_event(nfsi->lo_waitq,
>  				!pnfs_return_layout_barrier(nfsi, &arg));
>  		}
> +
> +		if (nfsi->layoutcommit_ctx) {
> +			status = pnfs_layoutcommit_inode(ino, 1);
> +			if (status) {
> +				dprintk("%s: layoutcommit failed, status=%d. "
> +					"Returning layout anyway\n",
> +					__func__, status);
> +				status = 0;
> +			}
> +		}

OK, I guess doing that after the send_return label is superfluous
as there should be nothing to layoutcommit if we got there after finding
no layout to return.

Benny

>  	}
>  send_return:
>  	status = return_layout(ino, &arg, stateid, type, lo);


      reply	other threads:[~2010-05-12  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11  8:59 [PATCH] pnfs: send layoutcommit until IO completed when return layout Zhang Jingwang
2010-05-12  6:51 ` Benny Halevy [this message]

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=4BEA4FE2.9070409@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=iisaman@citi.umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    --cc=zhangjingwang@nrchpc.ac.cn \
    /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.