pnfs: track last_offset for layoutcommit

iozone tests were failing intermittently against emc-2 due to out-of-order LAYOUTCOMMITs that both specified new_last_offset

nfs41_open_state now maintains a cached value of the last_offset, and avoids sending it with LAYOUTCOMMIT unless the new last_offset is greater than the cached offset.  this cached value is initialized on open/delegation, and updated on setattr for size

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-09-02 14:57:07 -04:00 committed by unknown
parent 93a907082c
commit 6872152317
4 changed files with 50 additions and 15 deletions

View file

@ -239,6 +239,8 @@ static int open_or_delegate(
if (status)
status = do_open(state, create, createhow, mode, try_recovery, info);
state->pnfs_last_offset = info->size ? info->size - 1 : 0;
/* register the client's open state on success */
if (status == NFS4_OK)
client_state_add(state);