Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6754776ybi; Wed, 29 May 2019 12:35:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKLI120+b+yNRlYcWStgPbuEXHDmwGCmpeI8QzpyPHb4pEAMRAhXoKnkYev3xr9r9x7cSf X-Received: by 2002:a17:902:a70f:: with SMTP id w15mr74309911plq.222.1559158547472; Wed, 29 May 2019 12:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559158547; cv=none; d=google.com; s=arc-20160816; b=qudcDbmmhBa2RNmraQH2o9qpDDMi62Zf/e+jCzQ3PcI2c1ZjiWcO0y4JkiPytsJney +tV1i/ZhDzHA43yypqDgbtekOwsWgqf1pRhXGGCUedCAFXc10p7mkjC45aIXApxhAwe8 3yJyf3/NM30SU8L25b+0YvV0+juThkoIiMjI0nbkhl9Ms6rAm0CyiBy8fisF9k9JGVqI LekNxJbCGPapLd6e/gR8caviuzQodlmwqZvqMXeagZS7oVbeNF88QhkX8IjNgLfOWSGw d126d3YFGWC5hziTPq9iGIWBj/Vg0owNf/TuG1LGLfL1DBxVPuqmxMsdFkCm9Lm4dGK0 Rmuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tw/in4/0sPsFRAIVvFcpom08CNRPJsSaR96xe+JZPYg=; b=RzLXzhT9qmD5+hm4ZvtPGsSGyqVCvs9YDcW211z0vl3YeB0OiT7dxb4pBP1KPjp8zA sHm+OP8IPZWzMpn5cW/7Q546DiJYhPo+2gtBVzGe/t59kyzoWCVrWysGe9fCBajMRmO3 cI66SXVee1g9rgPRRKIh2qPMwNG/gPrFAkFsjGoI2zPgtprcSFhJMV8SLMburo0DSjw3 nSc9YRI5vJmXBszl14TKJxr8InO3MUqbSw61yEcRDLXB1mxwTvxhXUF8AAaT0US66G6S iKyaNK4KbHFxHxAi+Hpnmi+DOPMO4FYuLRmcZBi0lcLmNxDRR9xUF3BkXKSE2GdLfe2V IAVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=blwqqvIR; 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 d2si693051pld.90.2019.05.29.12.35.27; Wed, 29 May 2019 12:35:47 -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=blwqqvIR; 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 S1726054AbfE2TfK (ORCPT + 99 others); Wed, 29 May 2019 15:35:10 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:37754 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfE2TfK (ORCPT ); Wed, 29 May 2019 15:35:10 -0400 Received: by mail-yb1-f194.google.com with SMTP id l66so1234269ybf.4; Wed, 29 May 2019 12:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tw/in4/0sPsFRAIVvFcpom08CNRPJsSaR96xe+JZPYg=; b=blwqqvIRbfuZTPTkrA3m0cr6Agq3a/vrtFTz1ERWN1amDZwfaEgVfuj4iedPvbA42v hXY7I17xk9dGtECbCcLE+DRtUj98OE8VIXOWZZJ89n7uGvl02UTsYXhE2Tlm+z4mA66t Qr8znFizytl1gVs3YRpa4IGe55fBifJAx+P7MdcJf/FGRT796nzUKFAVXwbanSwqeSBc k8eWIS4U+QS7zlkIgMHYRcUm7bM748E8rXkTWsnuTssYg8or9leX64thXDG7KyMg157w Tp8+JrbDJVw6KEYEkcylxraqQi9OpwjfexR0pUjNuzF8ZougS4wBHcQiN5ZQrG1pxq1K 5gCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tw/in4/0sPsFRAIVvFcpom08CNRPJsSaR96xe+JZPYg=; b=AtIQoNtUdTm6uy2G0z6dOm1OvcFt62eqBwgTbYzsExMsEPSFl6xh8QNtkFXNAAlZbe Z+E8b9shO+zmrwrIiFIg4r/UbQ/wAjfWpTuYoagS/MdRcTPoqq6spplbu4LBEnH77AFD 06IKk4Iae3DOBJLeARc5+RSYhzhdFcOB3qFEOHDAWdEcfy6B2OUMQGaTRlsznycV7BkY pyQtj0qAumETcRIUPhTnOUs8FVI1ynBpTBDqDbLXAuDbMHHNPweOslzwpaRLeD+y/TvD K7S7v9GCYCH5Ol/i3fdkzZ/IgxGuB6eFsqZ8Mjvqt63iXy7TSrHZ9okxy7Ir1B9LrwjA g2Xw== X-Gm-Message-State: APjAAAVf8UmA7DZgaWYUH23TqyFN/QwqpT1aSwkna561ug7cNbyQrbGX IE0uexBsmGUoLhRxauXNS6FCSTt1J1S+foi+1eI= X-Received: by 2002:a05:6902:4c3:: with SMTP id v3mr318648ybs.144.1559158509227; Wed, 29 May 2019 12:35:09 -0700 (PDT) MIME-Version: 1.0 References: <20190529174318.22424-1-amir73il@gmail.com> <20190529174318.22424-13-amir73il@gmail.com> In-Reply-To: <20190529174318.22424-13-amir73il@gmail.com> From: Amir Goldstein Date: Wed, 29 May 2019 22:34:58 +0300 Message-ID: Subject: Re: [PATCH v3 12/13] nfs: copy_file_range needs to strip setuid bits and update timestamps To: Olga Kornievskaia , Anna Schumaker , Trond Myklebust Cc: Dave Chinner , Christoph Hellwig , linux-xfs , Luis Henriques , Al Viro , linux-fsdevel , linux-api@vger.kernel.org, ceph-devel@vger.kernel.org, Linux NFS Mailing List , CIFS , "Darrick J . Wong" Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Olga,Anna,Trond Could we get an ACK on this patch. It is a prerequisite for merging the cross-device copy_file_range work. It depends on a new helper introduced here: https://lore.kernel.org/linux-fsdevel/CAOQ4uxjbcSWX1hUcuXbn8hFH3QYB+5bAC9Z1yCwJdR=T-GGtCg@mail.gmail.com/T/#m1569878c41f39fac3aadb3832a30659c323b582a Thanks, Amir, On Wed, May 29, 2019 at 8:43 PM Amir Goldstein wrote: > > 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 >