pnfs: send GETATTR after FILE_SYNC ds writes

in the case of ds writes returning FILE_SYNC, we don't need to send a COMMIT or LAYOUTCOMMIT to the mds.  COMMIT and LAYOUTCOMMIT, however, are the places where we do GETATTR(size) to update the attribute cache.  so we must add a separate call to GETATTR to accomplish this after ds writes return FILE_SYNC

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-10-21 09:50:11 -07:00 committed by unknown
parent 1f7e560a9a
commit 7efeb31a16

View file

@ -571,6 +571,12 @@ enum pnfs_status pnfs_write(
} else if (stable == DATA_SYNC4) { } else if (stable == DATA_SYNC4) {
/* send LAYOUTCOMMIT to sync the metadata */ /* send LAYOUTCOMMIT to sync the metadata */
status = layout_commit(state, layout, offset, *len_out); status = layout_commit(state, layout, offset, *len_out);
} else {
/* send a GETATTR to update the cached size */
nfs41_file_info info = { 0 };
bitmap4 attr_request;
init_getattr_request(&attr_request);
nfs41_getattr(state->session, &state->file, &attr_request, &info);
} }
out_free_pattern: out_free_pattern:
pattern_free(&pattern); pattern_free(&pattern);