From 7efeb31a165719c4f9d70d4fa5f88c2e86a3cf6b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 21 Oct 2011 09:50:11 -0700 Subject: [PATCH] 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 --- daemon/pnfs_io.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/pnfs_io.c b/daemon/pnfs_io.c index b83df3c..3ef9c93 100644 --- a/daemon/pnfs_io.c +++ b/daemon/pnfs_io.c @@ -571,6 +571,12 @@ enum pnfs_status pnfs_write( } else if (stable == DATA_SYNC4) { /* send LAYOUTCOMMIT to sync the metadata */ 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: pattern_free(&pattern); @@ -578,4 +584,4 @@ out: dprintf(IOLVL, "<-- pnfs_write() returning %s\n", pnfs_error_string(status)); return status; -} +} \ No newline at end of file