Re: [PATCH Version 1 06/11] NFSv4.1: send filelayout DS commits to the MDS on invalid deviceid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How does sending the commit to the MDS help if this is a commit-to-DS
setup? AFAICS we need to resend all the writes through the MDS.

On Thu, 2012-03-15 at 14:40 -0400, andros@xxxxxxxxxx wrote:
> From: Andy Adamson <andros@xxxxxxxxxx>
> 
> Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
> ---
>  fs/nfs/nfs4filelayout.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> index 2528cb2..26c83b0 100644
> --- a/fs/nfs/nfs4filelayout.c
> +++ b/fs/nfs/nfs4filelayout.c
> @@ -847,12 +847,16 @@ filelayout_choose_commit_list(struct nfs_page *req,
>  			      struct pnfs_layout_segment *lseg)
>  {
>  	struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg);
> +	struct nfs4_deviceid_node *devid = FILELAYOUT_DEVID_NODE(lseg);
>  	u32 i, j;
>  	struct list_head *list;
>  
>  	if (fl->commit_through_mds)
>  		return &NFS_I(req->wb_context->dentry->d_inode)->commit_list;
>  
> +	if (filelayout_test_devid_invalid(devid))
> +		return NULL; /* Resend I/O (writes and commits) to MDS */
> +
>  	/* Note that we are calling nfs4_fl_calc_j_index on each page
>  	 * that ends up being committed to a data server.  An attractive
>  	 * alternative is to add a field to nfs_write_data and nfs_page
> @@ -933,9 +937,14 @@ find_only_write_lseg_locked(struct inode *inode)
>  {
>  	struct pnfs_layout_segment *lseg;
>  
> -	list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list)
> +	list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list) {
> +		struct nfs4_deviceid_node *devid = FILELAYOUT_DEVID_NODE(lseg);
> +		if (filelayout_test_devid_invalid(devid))
> +			/* Resend I/O (writes and commits) to MDS */
> +			return NULL;
>  		if (lseg->pls_range.iomode == IOMODE_RW)
>  			return get_lseg(lseg);
> +	}
>  	return NULL;
>  }
>  

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux