Re: [PATCH 2/3] NFS: O_DIRECT pgio_completion_ops error_cleanup must unlock the request

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

 



On Mon, 2012-04-30 at 14:00 -0400, Trond Myklebust wrote:
> Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
> Cc: Fred Isaman <iisaman@xxxxxxxxxx>
> ---
>  fs/nfs/direct.c |   18 +++++++++++++++---
>  1 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
> index 5ce5c6b..450ba54 100644
> --- a/fs/nfs/direct.c
> +++ b/fs/nfs/direct.c
> @@ -292,7 +292,7 @@ out_put:
>  	hdr->release(hdr);
>  }
>  
> -static void nfs_sync_pgio_error(struct list_head *head)
> +static void nfs_read_sync_pgio_error(struct list_head *head)
>  {
>  	struct nfs_page *req;
>  
> @@ -309,7 +309,7 @@ static void nfs_direct_pgio_init(struct nfs_pgio_header *hdr)
>  }
>  
>  static const struct nfs_pgio_completion_ops nfs_direct_read_completion_ops = {
> -	.error_cleanup = nfs_sync_pgio_error,
> +	.error_cleanup = nfs_read_sync_pgio_error,
>  	.init_hdr = nfs_direct_pgio_init,
>  	.completion = nfs_direct_read_completion,
>  };
> @@ -772,8 +772,20 @@ out_put:
>  	hdr->release(hdr);
>  }
>  
> +static void nfs_write_sync_pgio_error(struct list_head *head)
> +{
> +	struct nfs_page *req;
> +
> +	while (!list_empty(head)) {
> +		req = nfs_list_entry(head->next);
> +		nfs_list_remove_request(req);
> +		nfs_release_request(req);
> +		nfs_unlock_request(req);
> +	}
> +}
> +
>  static const struct nfs_pgio_completion_ops nfs_direct_write_completion_ops = {
> -	.error_cleanup = nfs_sync_pgio_error,
> +	.error_cleanup = nfs_write_sync_pgio_error,
>  	.init_hdr = nfs_direct_pgio_init,
>  	.completion = nfs_direct_write_completion,
>  };

Alternatively, we could probably just send the write requests in an
unlocked state. They aren't supposed to be visible to anything via any
global lists...

-- 
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