From 03e810ce83870e5ba05f916bbd7315a46eb60385 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 20 Oct 2011 09:19:20 -0700 Subject: [PATCH] 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 --- daemon/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/readwrite.c b/daemon/readwrite.c index b61e507..d01b1ca 100644 --- a/daemon/readwrite.c +++ b/daemon/readwrite.c @@ -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)