diff mbox

NFSv4.1: Use correct stateid for read/write

Message ID 1349224549-11194-1-git-send-email-mora@cyclsvl29.eng.netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jorge Mora Oct. 3, 2012, 12:35 a.m. UTC
From: Jorge Mora <mora@netapp.com>

On pNFS, the correct stateid for read/write should not
be the LOCK stateid when the file has a byte range lock.

Signed-off-by: Jorge Mora <mora@netapp.com>
---
Fixes bug on Trond's testing branch
 fs/nfs/nfs4state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index c351e6b..681e659 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1036,7 +1036,8 @@  void nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state,
 {
 	if (nfs4_copy_delegation_stateid(dst, state->inode, fmode))
 		return;
-	if (nfs4_copy_lock_stateid(dst, state, lockowner))
+	if (pnfs_get_ds_info(state->inode) == NULL &&
+	    nfs4_copy_lock_stateid(dst, state, lockowner))
 		return;
 	nfs4_copy_open_stateid(dst, state);
 }