[pnfs] [PATCH 0/2] layout commit changes

Benny Halevy bhalevy at panasas.com
Wed Nov 29 10:24:51 EST 2006


Dean Hildebrand wrote:
> Hi Benny,
> 
> Benny Halevy wrote:
>> The following two patches implement changes we need for
>> layout commit.  The first patch one adds logic on the client
>> side to mark the inode for layout commit on the sync and async
>> write paths and to send the layoutcommit before close.
>>   
> I'm a little confused (but also a little behind the curve on the current 
> state of the code).  Could you explain what logic we have in place now 
> for sending layoutcommit and what are you adding?  Are there cases where 
> the file is closed and a layoutcommit is not issued?
> 
> Thanks,
> Dean
> 

It seems like the existing implementation associates layout commit with
data commit.

The inode is marked for layout commit (by calling
pnfs_need_layoutcommit) in the following cases:

- in pnfs4_commit_done(), pnfs_commit_done_norpc(), and
  nfs_direct_commit_result(), if (task->tk_status >= 0 &&
  pnfs_use_write(data->inode, -1))

  These happen when data is committed to data servers, right?

- in pnfs_file_write() if ld_io_ops->write() returned synchronously
  with result > 0

- in pnfs_writeback_done_update(), currently only for
  pnfs_use_nfsv4_wproto() && (committed == NFS_FILE_SYNC ||
  how == FLUSH_STABLE || call_ops == NULL)
  This is also related to committing data, but for other layout types
  not using nfsv4 as a storage proto I presume we better always mark
  the inode for layout commit here as mtime and/or length changed.

The layout commit itself is invoked only within nfs_sync_inode_wait()
and not on the close() path.  Again, this is related to syncing data
and not conveying attribute and layout changes back to the MDS.

My additions include:
- committing and returning the layout on close()

- optionally committing and returning the layout on setattr() (in
  another patch I sent)

- marking the inode for layout commit also in pnfs_writepages if the
  layout driver's write_pagelist() returned success synchronously
  (very similar to what's currently done in pnfs_file_write())

- mark the inode for layout commit in pnfs_writeback_done_update()
  when !pnfs_use_nfsv4_wproto(data->inode, argp->count)

>> The second patch adds a layout_commit export op and
>> calls it rather than notify_change if the file system
>> implemented it (we need it in order to avoid blocking
>> indefinitely in the setattr patch)
>>
>> Benny
>>
>> _______________________________________________
>> pNFS mailing list
>> pNFS at linux-nfs.org
>> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>>   
> 



More information about the pNFS mailing list