diff mbox

[14/16] NFS in copy use stateid returned by copy_notify

Message ID 1441050606-40897-15-git-send-email-andros@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Adamson Aug. 31, 2015, 7:50 p.m. UTC
From: Olga Kornievskaia <kolga@netapp.com>

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs42proc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index 42cab7e..e33734d 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -191,15 +191,17 @@  static ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
 			args.cp_src[0].u.nl4_addr.na_netid,
 			args.cp_src[0].u.nl4_addr.na_uaddr_len,
 			args.cp_src[0].u.nl4_addr.na_uaddr);
+
+		nfs4_stateid_copy(&args.src_stateid, &cn_res->cnr_stateid);
+	} else {
+		status = nfs42_set_rw_stateid(&args.src_stateid, src, FMODE_READ);
+		if (status)
+			return status;
 	}
 
 	if (!(server->caps & NFS_CAP_COPY))
 		return -ENOTSUPP;
 
-	status = nfs42_set_rw_stateid(&args.src_stateid, src, FMODE_READ);
-	if (status)
-		return status;
-
 	status = nfs42_set_rw_stateid(&args.dst_stateid, dst, FMODE_WRITE);
 	if (status)
 		return status;