[pnfs] [PATCH 17/37] pnfs: call LD's free_layout before pnfs_return_layout_rpc

Benny Halevy bhalevy at panasas.com
Thu Jan 3 04:30:18 EST 2008


On Jan. 03, 2008, 0:41 +0200, Dean Hildebrand <seattleplus at gmail.com> wrote:
> 
> Benny Halevy wrote:
>> free_layout is called in any case (even if the layoutreturn rpc fails)
>> and it's ok according to the nfsv4.1 spec for the client to forget about
>> the layout before returning it.
>>
>> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
>> ---
>>  fs/nfs/pnfs.c |   15 +++------------
>>  1 files changed, 3 insertions(+), 12 deletions(-)
>>
>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>> index ced7f30..cb8115f 100644
>> --- a/fs/nfs/pnfs.c
>> +++ b/fs/nfs/pnfs.c
>> @@ -344,6 +344,9 @@ pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range)
>>  	if (nfsi->current_layout == NULL)
>>  		return 0;
>>  
>> +	server->pnfs_curr_ld->ld_io_ops->free_layout(
>> +		&nfsi->current_layout, &arg.lseg);
>> +
>>   
> Do we need to check if free_layout exists?

You're right.  I had a private version that provided for a default
implementation for alloc_layout and free_layout in case the layout driver
doesn't implement them and I decided to drop it, however I did not
add a check that mandates their implementation like in
"pnfs: client layout cache: require layout driver {alloc,free}_lseg"
http://git.linux-nfs.org/?p=bhalevy/linux-pnfs.git;a=commitdiff;h=b72cee231e16964544208a5793eae55b7b76438f

I'll add that, thanks!

Benny

> Dean



More information about the pNFS mailing list