Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6831034ybi; Wed, 29 May 2019 14:01:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR61l7+Q0bwaJDhHnKIeFIr0JWahFxfLBNn+6HYo130KU5c6u3coRh+JAr4KLnotLAJMlz X-Received: by 2002:a63:f807:: with SMTP id n7mr6464pgh.47.1559163715457; Wed, 29 May 2019 14:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559163715; cv=none; d=google.com; s=arc-20160816; b=AVqqDvhx3bjVO6SvIukClPYM6F2+yit5HVcfghx3JRIdZXqgTMGrXeehZOmR8nORTm JVQONuzWTV+57QA9dl04/ydZsUlKuLAqMTmyxF5HIhmn2eHWISZA+uisxiaurP70O+UT vjp9T8T1PrURHIF5JWk7vZLqMPERVv/PZ9SADYMgUsfuuj/uRRVDFnTs9iTd0lTWiC8V gLRsmKaQVmrPOPC/cjSQaW/3KNL/GjdaqP4KQmbaeNlrkvQlTBYYlA6ZMb7Dq6R7BM4T vIdtPQWfNbBpclNmIYugErgomT/Cy0jGU9nvclmaDI66+t5zVgj5Mayb5TcETgErzAYT X/iA== 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=2bUX9HHLDimGpHftlxiZFbL0LRNK02ZuHhjX+WUCqPs=; b=fB4epBUyzyJwt4GorHEPUvAhBWAVGH+7LaX5JdI5y5q6cTPVzGF7V0+S2TaJ2HdSaG 8gxU1jxuphxCjD5H/RFSa0U5NTbNBwYh1aBp5wpoTKVNvuhle8WDVzWhGm5YpuIOW67E E3WECTlgej9SUvjERYIwaJilxVc/gOwH/pUVeRX72R8wmOU68z//al60BVoSKF24jYmd KCAVKaVszYV0pyoWyBDWRvVlrRzQAVDBMny4iStUIeK3w1C4kY34M0+YNaolamR56XZg m/2yD68LjNPzu76dC5+5r/SiGoV4YWsjg+Z9ASh4NxejsuFK+lSsOEBtoFVxpy6+j26b OB/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mokTnnsR; 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 z9si871395pgi.341.2019.05.29.14.01.28; Wed, 29 May 2019 14:01:55 -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=mokTnnsR; 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 S1726547AbfE2VBC (ORCPT + 99 others); Wed, 29 May 2019 17:01:02 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:42040 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfE2VBB (ORCPT ); Wed, 29 May 2019 17:01:01 -0400 Received: by mail-yw1-f66.google.com with SMTP id s5so1663890ywd.9; Wed, 29 May 2019 14:01:01 -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=2bUX9HHLDimGpHftlxiZFbL0LRNK02ZuHhjX+WUCqPs=; b=mokTnnsRdjT1v9zXbMeJ8tMVuwGBi9oZieTmqfLND4TQvuv+6jYtzMpalLNeGnT8OE qLACIUrBtyV6h9Tc5JogpdaL7A/jqf9qpUVZOetoZ3/JtYd9XV8Bk/PLRr0mV4lilWCy Zzues0JQGQuvgVDBXvscVDBj/gKJ65K7d8ECbfQxgoYZJ1VJ9VvScP5eu60wCuUsEXB6 R+omRXtO+AJBLqI3vpt2gZ5zvIzPhSXOmq5TZQbV/GlnbeXEn9p/eEgq2t+9GTijHWXA rERh2cPUv88AjcLOg1qw2fDegTzoESZ766o7y3cxugW8mnSeP5s1Il/FQfKZc3LBYIt5 7/mw== 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=2bUX9HHLDimGpHftlxiZFbL0LRNK02ZuHhjX+WUCqPs=; b=Y9ziizeJ6MQ0u8vDh2w8CV5SRr6GauNAQygz3jf2/kV7vNesOMJ2fhbENuHVFH/d1V UMwB48QCvDEBwYERgyVMEauBNlmuTqoz2zAQekudrkKAN/eVUlg2vr3+DYEf1b+1wX/u LZeDPWfwh60p614oqd0Fy6zGxC9rFxjRrM6ZNk8fSYjJoX7l5/y2baigl3SNqZQAOfe5 xzQ53XLqKo/dvqDeI2F0mL2W5ILezqRNBL5tnL7doYaRI0mgEvJcuVrzX6rhkfMIuz5c AdZBUH1+5dbemB98YKbye3kvh/NPu6gafY797nj5wOtiarEpgQcppExPqCbfce/ajCqe YGsQ== X-Gm-Message-State: APjAAAWjDE2DJMP88ftyiepiymr+3MwOHlfm4EXhX/twr1Vz0mYFU4oO z90WzMmQqQb7y6BbMCh+zaX22IBO3s8u4qyPkUg= X-Received: by 2002:a81:4f06:: with SMTP id d6mr48990950ywb.379.1559163660713; Wed, 29 May 2019 14:01:00 -0700 (PDT) MIME-Version: 1.0 References: <20190529174318.22424-1-amir73il@gmail.com> <20190529174318.22424-13-amir73il@gmail.com> In-Reply-To: From: Amir Goldstein Date: Thu, 30 May 2019 00:00:49 +0300 Message-ID: Subject: Re: [PATCH v3 12/13] nfs: copy_file_range needs to strip setuid bits and update timestamps To: Trond Myklebust Cc: "Anna.Schumaker@netapp.com" , "olga.kornievskaia@gmail.com" , "hch@lst.de" , "linux-cifs@vger.kernel.org" , "david@fromorbit.com" , "linux-fsdevel@vger.kernel.org" , "ceph-devel@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "viro@zeniv.linux.org.uk" , "lhenriques@suse.com" , "linux-nfs@vger.kernel.org" , "darrick.wong@oracle.com" 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 On Wed, May 29, 2019 at 11:02 PM Trond Myklebust wrote: > > On Wed, 2019-05-29 at 22:34 +0300, Amir Goldstein wrote: > > 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 > > > > > Please drop this patch. In the NFS protocol, the client is not expected > to mess with atime or mtime other than when the user explicitly sets it > through a call to utimensat() or similar. The server takes care of any > a/mtime updates as and when the file is read/written to. > > Ditto for suid/sgid clearing. > > Motto: "No file_accessed() or file_remove_privs() calls, please. We're > NFS." OK. Thanks, Amir.