All of lore.kernel.org
 help / color / mirror / Atom feed
From: <andros@netapp.com>
To: <trond.myklebust@primarydata.com>
Cc: <anna.schumaker@netapp.com>, <bfields@fieldses.org>,
	<linux-nfs@vger.kernel.org>, Olga Kornievskaia <kolga@netapp.com>
Subject: [PATCH Version 2 14/16] NFS in copy use stateid returned by copy_notify
Date: Fri, 4 Sep 2015 13:29:36 -0400	[thread overview]
Message-ID: <1441387778-16465-15-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1441387778-16465-1-git-send-email-andros@netapp.com>

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 --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;
-- 
1.8.3.1


  parent reply	other threads:[~2015-09-04 17:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 17:29 [PATCH Version 2 00/16] NFSv4.2: Add support for inter-server to server COPY andros
2015-09-04 17:29 ` [PATCH Version 2 01/16] VFS: Separate cross fs check from vfs_copy_file_range andros
2015-09-04 17:29 ` [PATCH Version 2 02/16] BTRFS: Use VFS copy offload helper andros
2015-09-04 17:29 ` [PATCH Version 2 03/16] VFS SQUASH use file_out instead of file_in for copy_file_range andros
2015-09-04 17:29 ` [PATCH Version 2 04/16] NFS COPY xdr changes andros
2015-09-04 17:29 ` [PATCH Version 2 05/16] NFS add same file check and flush source and destination for COPY andros
2015-09-04 17:29 ` [PATCH Version 2 06/16] NFS add inter ssc functions to nfs42proc andros
2015-09-04 17:29 ` [PATCH Version 2 07/16] NFS add COPY_NOTIFY operation andros
2015-09-04 17:29 ` [PATCH Version 2 08/16] NFSD add ca_source_server<> to COPY andros
2015-09-04 17:29 ` [PATCH Version 2 09/16] NFSD add COPY_NOTIFY operation andros
2015-09-04 17:29 ` [PATCH Version 2 10/16] NFS add ca_source_server<> to COPY andros
2015-09-04 17:29 ` [PATCH Version 2 11/16] NFSD generalize nfsd4_compound_state flag names andros
2015-09-04 17:29 ` [PATCH Version 2 12/16] NFSD: allow inter server COPY to have a STALE source server fh andros
2015-09-04 17:29 ` [PATCH Version 2 13/16] NFSD add nfs4 inter ssc to nfsd4_copy andros
2015-09-04 17:29 ` andros [this message]
2015-09-04 17:29 ` [PATCH Version 2 15/16] NFS always use openstateid in COPY_NOTIFY andros
2015-09-04 17:29 ` [PATCH Version 2 16/16] NFSD: extra stateid checking in read for interserver copy andros
2015-10-02 14:45 ` [PATCH Version 2 00/16] NFSv4.2: Add support for inter-server to server COPY J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441387778-16465-15-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=kolga@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.