Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6642429ybi; Wed, 29 May 2019 10:44:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaDvOgZVzkkCtg/2rAnUah/1er7ROdkcO28oCfwU6VhEYJTqa/CJ8RCmKrbFc56FkfaAmh X-Received: by 2002:a65:4806:: with SMTP id h6mr64220446pgs.299.1559151858030; Wed, 29 May 2019 10:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559151858; cv=none; d=google.com; s=arc-20160816; b=KNuKyEQ+xNBL629tWuyUbGcOhmeN2pJ9UCRf5lCgWTmut+/ynCh48vjnUpe9dFlRtI F93+4SXCUtiOP7nVHVVLL+tXDAHLBrrRlJF2h2alFTXfDQfR0D03v5mCugkzUz6dn5vu CLncvmcIl6ALSTCwNfexixn1e6TGoNSZ2FssnNmNLdiH8PynKMbxnYwc60Jvsq981FwK YxLvhUJ9gWljHQLK9j504goqnlTl2sst2SVhCpNh19rvXY2x7YkJlrvlTkUuzFN8JOk9 nAr3UYC+8qqiXyadIbFM23TsjJZCaDarg8lpqthgvyYGg+y6tcibc3/XUX7U5T9ia/HG NCfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HN28jzdWIDmYfqKHB1OqlcDa2tkQLMvz+g74LeD+kio=; b=a8AjUpZLBeYd0XENUnDywWT6afnWR13S/js1IxOCnl+kM+gcMSh3WpEW24I20gfUiF FNIUqt8o/0iSWSSmLAzxbNAHbXkyUGnWNWWrQ1I/57h9B57YLEQfBLfc/+V4LqPnlPlq epS/YukwxspEywqCYm6CegylhKWGB6hBr2iU0KvSeBy3Oog+20L83fVgbFOBQJ01O6iV gRqw0o/aXQGGcRKf7SEd3vyrYsd+8PE19XlFGJdXwd2izhrGmMyhm+aUXq3Szluja5Tf ITNZybdH/R7Ch1rQb+AXiasD6Pc65GX+y++hQp2Qvo9FBsRNBuqnUuvF3BmekxkRmnK7 hzoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUf3gpx4; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37si309307pla.288.2019.05.29.10.44.04; Wed, 29 May 2019 10:44:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUf3gpx4; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727468AbfE2Rnx (ORCPT + 99 others); Wed, 29 May 2019 13:43:53 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42156 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbfE2Rnw (ORCPT ); Wed, 29 May 2019 13:43:52 -0400 Received: by mail-wr1-f68.google.com with SMTP id l2so2379619wrb.9; Wed, 29 May 2019 10:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HN28jzdWIDmYfqKHB1OqlcDa2tkQLMvz+g74LeD+kio=; b=JUf3gpx4X+xBASgixo3psABkDGhXiKV7Lv6aCmi3cIY5g3UvcqkbbvIo4LEBHHlOcM 47HvlL4K1Cfr3ZCYRlFlQMk169fxuc4V9OE11x9tSy5YsvifN+2+3lazi2lND22my4/4 vd26PGS+5Js9jWQid+RCNzQaf/Cxq14XwTGKpzF/Q1Bka7r0NBU4GOkAB1YemhBS82Bd Lb9aAjs9AjZ7/j02/iDPiRAipCy9DyKOAKm748nAnJr525j6GQIkn1vJLKJPSxueSVCR /PoGsscocZt9StBbSuN5VS082vCWGMzYH/2Eb9v2UTVF6paGYYjXEs0W0yHzHIGdVPtu C46w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HN28jzdWIDmYfqKHB1OqlcDa2tkQLMvz+g74LeD+kio=; b=MS3J53CKNFFz2rSBpksU06XDAGDj5zEwBl97iWik1SdEGEpAu2hHiKo+yeEmArIUdH lVEdbH+QoprW0X1IMQcPfUtTLbUfKvZEyepItdQ6QjxR6pUsEu0l0We+CMDP4UeQeOxb kTHBgPvlK9+tKT5LA4QixKCRxlZNGa6TjE4ZXh7uVD+wiALxQLko4Dde1GHWKU7lx/vp WhMoxl6fMWMFPIveljlgAIdfjq2zvi8GpNgM/V0ksTdqUzcixcWRMogRtSZl0/SOYpPI gAf8s+A2QWO4oqNnn/WLPUeXtLXSkF+RtITh+807gT7Pfn16DXb+jUsKAvb1bvl0TlRT 0bsA== X-Gm-Message-State: APjAAAVTvoCspflraceM8mhM/vJyv87EVG6nZE5hambx2Ehn6+94HYzl B60kVO5j7/HCi8OZDQrjpBk= X-Received: by 2002:a5d:54cc:: with SMTP id x12mr35442527wrv.303.1559151830843; Wed, 29 May 2019 10:43:50 -0700 (PDT) Received: from localhost.localdomain ([5.102.238.208]) by smtp.gmail.com with ESMTPSA id k125sm31702wmb.34.2019.05.29.10.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 10:43:50 -0700 (PDT) From: Amir Goldstein To: "Darrick J . Wong" Cc: Dave Chinner , Christoph Hellwig , linux-xfs@vger.kernel.org, Olga Kornievskaia , Luis Henriques , Al Viro , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org Subject: [PATCH v3 12/13] nfs: copy_file_range needs to strip setuid bits and update timestamps Date: Wed, 29 May 2019 20:43:16 +0300 Message-Id: <20190529174318.22424-13-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190529174318.22424-1-amir73il@gmail.com> References: <20190529174318.22424-1-amir73il@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Like ->write_iter(), we update mtime and strip setuid of dst file before copy and like ->read_iter(), we update atime of src file after copy. Signed-off-by: Amir Goldstein --- fs/nfs/nfs42proc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 5196bfa7894d..c37a8e5116c6 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -345,10 +345,13 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src, do { inode_lock(file_inode(dst)); - err = _nfs42_proc_copy(src, src_lock, - dst, dst_lock, - &args, &res); + err = file_modified(dst); + if (!err) + err = _nfs42_proc_copy(src, src_lock, + dst, dst_lock, + &args, &res); inode_unlock(file_inode(dst)); + file_accessed(src); if (err >= 0) break; -- 2.17.1