NFSv4.1: don't send COMMIT to ds for data sync writes
authorFred Isaman <iisaman@netapp.com>
Wed, 23 Mar 2011 13:27:44 +0000 (13:27 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 23 Mar 2011 19:29:02 +0000 (15:29 -0400)
Based on consensus reached in Feb 2011 interim IETF meeting regarding
use of LAYOUTCOMMIT, it has been decided that a NFS_DATA_SYNC return
from a WRITE to data server should not initiate a COMMIT.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/write.c

index 55a8c36712331f031446bb56cb82819d92b5d8b6..92b4a6614fd333c82a28cf60ebf5a0922a3c57af 100644 (file)
@@ -474,7 +474,10 @@ nfs_clear_request_commit(struct nfs_page *req)
 static inline
 int nfs_write_need_commit(struct nfs_write_data *data)
 {
-       return data->verf.committed != NFS_FILE_SYNC;
+       if (data->verf.committed == NFS_DATA_SYNC)
+               return data->lseg == NULL;
+       else
+               return data->verf.committed != NFS_FILE_SYNC;
 }
 
 static inline