Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6756564ybi; Wed, 29 May 2019 12:37:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCaNEGOy1DP7xXUHI6fSdVL1/zqQ2MHK8Pl4YVBlOtTYyif31NF9mpYl01hGxq+e+Y3H5K X-Received: by 2002:a63:5b5c:: with SMTP id l28mr95401298pgm.158.1559158666151; Wed, 29 May 2019 12:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559158666; cv=none; d=google.com; s=arc-20160816; b=cmUHpAzuj6byGyvzrMnFsLSDGDJDIYxljylO5B3wQqI2Iq1LEuh+9hriXaduqNFu+K rhwsZUGknOBeylwBlKeOqODAKnfX++uivFYhZDqoLFP+4q9KyK8aRf3oaOdYKEFzb3j0 WKIQKidryGQM4zumRao27C7XaRPxu5o75BtGHzWOR9X4S6cBh9WZMaD+N92nPsBXVynP giboTufuOMs202jrtfC37dG2U4GvmNTWKmD3ny/BnAV6I20EaIJYgqrflFmjuIiE02Q3 NtkYln7DaZgWR3JOZgiuFy/5Mj1u97Hx9mdroicmXfKOPCzoqoAlXj1tvKDXW190bQyW xthA== 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=7mEjgHYQ04qmca/Pwc7iF7uxZsyWUtmaIoM2mZ31LQc=; b=x29TWGjkcjd8ISRmjnrL8o5Cj1FKCbwB9NuI0VoAYqhL/6cW0tKP5uhZWlAR37wyyT /b6xJyn/w/wjn5j740PpxXRm3vq1cTdGbevEKNOgw6TC2fIElcjT5QfAe2Qsb4IGLde/ pG+6vyNM4SEukPp+X6yTjwG17uLXPTLzSkJj4+X2WSTFJFyKfHNK4wtHhhNWxZXur7Ix wX7y2SupSuRjtIXS9hb6lOb7THjal4Pef9uQA3LMzeAtFx0tQYDwyjhER0wUzeBmRHDv DhdfnNamkYH9CNSKfQY1L5bKehjIK0XgM/UPaMHf04W2OR8gJL+mR8X45WK6FbHIgJa4 O3fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZqWrslUQ; 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 s6si638430plq.246.2019.05.29.12.37.32; Wed, 29 May 2019 12:37:46 -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=ZqWrslUQ; 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 S1726125AbfE2Tg3 (ORCPT + 99 others); Wed, 29 May 2019 15:36:29 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:37792 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfE2Tg3 (ORCPT ); Wed, 29 May 2019 15:36:29 -0400 Received: by mail-yb1-f193.google.com with SMTP id l66so1235631ybf.4; Wed, 29 May 2019 12:36:28 -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=7mEjgHYQ04qmca/Pwc7iF7uxZsyWUtmaIoM2mZ31LQc=; b=ZqWrslUQMdbel0zaoDjEn6UvUaq0aUP7KhexsRNdGhbCvxekatAwIPxf356JrUDnOx C09DY60ki0ngftPh+10L/hTshAMMNzEeRbZR+HR9lh7DDk3HTHAkIZdOKBkMQDFchkqC BSrqcVT3r8KKQ9pwKM0YVXOOU0nv55jbtupzPoHq7qHWUZ6IoTj2y0ca3+6XYBeElMT7 03LMn0p0gKX1NG7mSOOfFb0wK616PofkM/rP++cD2mKAQ69vRbC8C1ovkzRcM3uWJlua dHj2GlH4/IxhE8ZSch32KCQIrgmeh0cRM3GjCL1souIZ1RnwBafeARtfAIi0MtidEXfX xSjQ== 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=7mEjgHYQ04qmca/Pwc7iF7uxZsyWUtmaIoM2mZ31LQc=; b=bLqjKAPDQ+m+OeIe8aXUO6BdnIfRtqeP/Tl1eE1wg0oX6Kl1zsxUX1p0eiXjFDdOcR zvQBwnjT45hR10c1hKPxeX6KG8uc0K+XhT1hDCIg1ZBE2RLSY93p8ljAxh6/yeQYi12Z hs4V7xsbov84hG2XUthASsynA6Ghb6rjd8gOvAgp5WrxoToJsZ2aOkI9oC6dXC/lnyab L/K16enQvbeVgU2Ytgn30NxXSrWkEJLZEFI13+cwL5ZxUehBzC/ugF5ydjtKhXCZiY7z E/6GeFiKM/WSBBM6UFo9Lqy2UhmqP/0em1FyMW/Ch7hyXIcBtINx3NTnbFdBkcZie27F 1HZQ== X-Gm-Message-State: APjAAAWoJ5eqkodIfdP84n/IserMwvplEBdjUpdKZ6XSD3V2ewbp3qYU oCGI1nD2zQHkGE2p35Va1w4n1OqAnIHuiFvSCzISof9p7zQ= X-Received: by 2002:a25:b202:: with SMTP id i2mr26730349ybj.439.1559158588100; Wed, 29 May 2019 12:36:28 -0700 (PDT) MIME-Version: 1.0 References: <20190529174318.22424-1-amir73il@gmail.com> <20190529174318.22424-11-amir73il@gmail.com> In-Reply-To: <20190529174318.22424-11-amir73il@gmail.com> From: Amir Goldstein Date: Wed, 29 May 2019 22:36:16 +0300 Message-ID: Subject: Re: [PATCH v3 10/13] cifs: copy_file_range needs to strip setuid bits and update timestamps To: Steve French Cc: Dave Chinner , Christoph Hellwig , linux-xfs , Olga Kornievskaia , Luis Henriques , Al Viro , "Darrick J . Wong" , linux-fsdevel , linux-api@vger.kernel.org, ceph-devel@vger.kernel.org, Linux NFS Mailing List , CIFS 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 Steve, 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: > > cifs has both source and destination inodes locked throughout the copy. > Like ->write_iter(), we update mtime and strip setuid bits of destination > file before copy and like ->read_iter(), we update atime of source file > after copy. > > Signed-off-by: Amir Goldstein > --- > fs/cifs/cifsfs.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c > index c65823270313..ab6c5c24146d 100644 > --- a/fs/cifs/cifsfs.c > +++ b/fs/cifs/cifsfs.c > @@ -1096,6 +1096,10 @@ ssize_t cifs_file_copychunk_range(unsigned int xid, > goto out; > } > > + rc = -EOPNOTSUPP; > + if (!target_tcon->ses->server->ops->copychunk_range) > + goto out; > + > /* > * Note: cifs case is easier than btrfs since server responsible for > * checks for proper open modes and file type and if it wants > @@ -1107,11 +1111,12 @@ ssize_t cifs_file_copychunk_range(unsigned int xid, > /* should we flush first and last page first */ > truncate_inode_pages(&target_inode->i_data, 0); > > - if (target_tcon->ses->server->ops->copychunk_range) > + rc = file_modified(dst_file); > + if (!rc) > rc = target_tcon->ses->server->ops->copychunk_range(xid, > smb_file_src, smb_file_target, off, len, destoff); > - else > - rc = -EOPNOTSUPP; > + > + file_accessed(src_file); > > /* force revalidate of size and timestamps of target file now > * that target is updated on the server > -- > 2.17.1 >