[pnfs] [PATCH 4/4] pnfs: Explicitly set error return in file layout

Benny Halevy bhalevy at panasas.com
Mon May 12 13:29:22 EDT 2008


On May. 12, 2008, 10:01 -0700, Dean Hildebrand <seattleplus at gmail.com> wrote:
> 
> Benny Halevy wrote:
>> On May. 11, 2008, 0:07 -0700, Dean Hildebrand <seattleplus at gmail.com> wrote:
>>   
>>> Set pnfserror in file layout write and
>>> read pagelist and fix up some return
>>> comments.
>>>
>>> Signed-off-by: Dean Hildebrand <dhildeb at us.ibm.com>
>>> ---
>>>  fs/nfs/nfs4filelayout.c |   11 ++++++-----
>>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
>>> index bc1d0fe..a57ab9a 100644
>>> --- a/fs/nfs/nfs4filelayout.c
>>> +++ b/fs/nfs/nfs4filelayout.c
>>> @@ -292,6 +292,8 @@ static int filelayout_read_pagelist(
>>>  		/* Now get the file offset on the dserver
>>>  		 * Set the read offset to this offset, and
>>>  		 * save the original offset in orig_offset
>>> +		 * In the case of aync reads, the offset will be reset in the
>>> +		 * call_ops->rpc_call_done() routine.
>>>  		 */
>>>  		data->args.offset = filelayout_get_dserver_offset(offset,
>>>  								  flseg);
>>> @@ -301,10 +303,8 @@ static int filelayout_read_pagelist(
>>>  	/* Perform an asynchronous read */
>>>  	nfs_initiate_read(data, data->pnfs_client, &filelayout_read_call_ops);
>>>  
>>> -	/* In the case of aync reads, the offset will be reset in the
>>> -	 * call_ops->rpc_call_done() routine.
>>> -	 */
>>> -	status = 0;
>>> +	dprintk("%s: pnfse %d\n",__func__, data->pnfs_error);
>>>     
>> Why print pnfs_error right before setting it to zero?
>>   
> Hmm, I think you are mistaking a - for a +....

Are you sure?
you have this in your patch:

-	status = 0;
+	dprintk(... data->pnfs_error);
+	data->pnfs_error = 0;

and later

-
+	dprintk(... data->pnfs_error);
+	data->pnfs_error = 0;

Benny

>> Also, checkpatch picked this nit:
>>
>> ERROR: space required after that ',' (ctx:VxV)
>> #35: FILE: fs/nfs/nfs4filelayout.c:306:
>> +	dprintk("%s: pnfse %d\n",__func__, data->pnfs_error);
>>   
> check, let me fix'em. 
> Dean
>>   
>>> +	data->pnfs_error = 0;
>>>  
>>>  	return status;
>>>  }
>>> @@ -377,7 +377,8 @@ static int filelayout_write_pagelist(
>>>  	 */
>>>  	nfs_initiate_write(data, data->pnfs_client,
>>>  			   &filelayout_write_call_ops, sync);
>>> -
>>> +	dprintk("%s: pnfse %d\n",__func__, data->pnfs_error);
>>>     
>> ditto(s)
>>
>>   
>>> +	data->pnfs_error = 0;
>>>  	return 0;
>>>  }
>>>  
>>>     
>>   



More information about the pNFS mailing list