From patchwork Mon Aug 31 19:50:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 7101371 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C9DFBEEC1 for ; Mon, 31 Aug 2015 19:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86819203EB for ; Mon, 31 Aug 2015 19:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DADA201E4 for ; Mon, 31 Aug 2015 19:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754104AbbHaTut (ORCPT ); Mon, 31 Aug 2015 15:50:49 -0400 Received: from mx141.netapp.com ([216.240.21.12]:32317 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753065AbbHaTus (ORCPT ); Mon, 31 Aug 2015 15:50:48 -0400 X-IronPort-AV: E=Sophos;i="5.17,443,1437462000"; d="scan'208";a="66393422" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx141-out.netapp.com with ESMTP; 31 Aug 2015 12:50:33 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server id 15.0.1076.9; Mon, 31 Aug 2015 12:50:32 -0700 Received: from rhel7-1-snap3-3.localdomain (dros-16.vpn.netapp.com [10.55.66.171]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id t7VJoJI4019457; Mon, 31 Aug 2015 12:50:32 -0700 (PDT) From: To: CC: , , , Olga Kornievskaia Subject: [PATCH 14/16] NFS in copy use stateid returned by copy_notify Date: Mon, 31 Aug 2015 15:50:04 -0400 Message-ID: <1441050606-40897-15-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1441050606-40897-1-git-send-email-andros@netapp.com> References: <1441050606-40897-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Olga Kornievskaia Signed-off-by: Olga Kornievskaia --- 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;