write: use FILE_SYNC for small writes

small mds writes were using DATA_SYNC4 and were not followed by COMMITs, so there was no guarantee of an updated file size before returning success

use FILE_SYNC4 for these small writes, and send COMMITs for both UNSTABLE4 and DATA_SYNC4

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-10-20 09:19:20 -07:00 committed by unknown
parent 3d053740c3
commit 03e810ce83

View file

@ -196,8 +196,8 @@ retry_write:
to_send = args->len;
reloffset = 0;
len = 0;
stable = to_send <= maxwritesize ? DATA_SYNC4 : UNSTABLE4;
committed = DATA_SYNC4;
stable = to_send <= maxwritesize ? FILE_SYNC4 : UNSTABLE4;
committed = FILE_SYNC4;
if (to_send > maxwritesize)
dprintf(1, "handle_nfs41_write: writing %d in chunks of %d\n",
@ -223,7 +223,7 @@ retry_write:
goto out_verify_failed;
}
}
if (committed == UNSTABLE4) {
if (committed != FILE_SYNC4) {
dprintf(1, "sending COMMIT for offset=%d and len=%d\n", args->offset, len);
status = nfs41_commit(session, file, args->offset, len, 1, &verf);
if (status)