Skip to contentSkip to conversation

: Pure nfs client performance using odirect.

PATCH In review Arun R Bharadwaj 3 participants 3 messages Nov 18, 2010 – Dec 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Pure nfs client performance using odirect.

Pure nfs client performance using odirect.

When an application opens a file with O_DIRECT flag, if the size of the data that is written is equal to wsize, the client sends a WRITE RPC with stable flag set to UNSTABLE followed by a single COMMIT RPC rather than sending a single WRITE RPC with the stable flag set to FILE_SYNC. This a bug.

Patch to fix this.

fs/nfs/direct.c +1 -1
Index: linux-2.6.36-rc7/fs/nfs/direct.c
===================================================================
@@ -867,7 +867,7 @@
 		goto out;
 	nfs_alloc_commit_data(dreq);
 
-	if (dreq->commit_data == NULL || count < wsize)
+	if (dreq->commit_data == NULL || count <= wsize)
 		sync = NFS_FILE_SYNC;
 
 	dreq->inode = inode;
#1 lore raw
Quoted 17 lines · Arun R Bharadwaj

Pure nfs client performance using odirect.

When an application opens a file with O_DIRECT flag, if the size of the data that is written is equal to wsize, the client sends a WRITE RPC with stable flag set to UNSTABLE followed by a single COMMIT RPC rather than sending a single WRITE RPC with the stable flag set to FILE_SYNC. This a bug.

Patch to fix this.

Index: linux-2.6.36-rc7/fs/nfs/direct.c
===================================================================

fs/nfs/direct.c line 873

Quoted 8 lines
fs/nfs/direct.c +1 -1
@@ -867,7 +867,7 @@
 		goto out;
 	nfs_alloc_commit_data(dreq);
 
-	if (dreq->commit_data == NULL || count < wsize)
+	if (dreq->commit_data == NULL || count <= wsize)
 		sync = NFS_FILE_SYNC;
 
 	dreq->inode = inode;

This looks reasonable, though I haven't looked closely at the surrounding code. It's probably been in the code for a very long time. I'm surprised no-one caught it sooner.

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arun R Bharadwaj
Quoted 26 lines · On Thu, 18 Nov 2010 16:06:43 +0530 Arun R Bharadwaj <[email protected]>…

Pure nfs client performance using odirect.

When an application opens a file with O_DIRECT flag, if the size of the data that is written is equal to wsize, the client sends a WRITE RPC with stable flag set to UNSTABLE followed by a single COMMIT RPC rather than sending a single WRITE RPC with the stable flag set to FILE_SYNC. This a bug.

Patch to fix this.

Index: linux-2.6.36-rc7/fs/nfs/direct.c
===================================================================

fs/nfs/direct.c +1 -2
@@ -867,7 +867,7 @@
 		goto out;
 	nfs_alloc_commit_data(dreq);
 
-	if (dreq->commit_data == NULL || count < wsize)
+	if (dreq->commit_data == NULL || count <= wsize)
 		sync = NFS_FILE_SYNC;
 
 	dreq->inode = inode;
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Looks right to me.