Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5232807ybi; Tue, 28 May 2019 09:32:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFA+aE3LgPclNToMebGZpAVZOjMy5CF22Qa1A9ysXWFMV7vCSkLy65MmbIeGUX9pTfj+Uw X-Received: by 2002:aa7:87d7:: with SMTP id i23mr142575405pfo.211.1559061157123; Tue, 28 May 2019 09:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559061157; cv=none; d=google.com; s=arc-20160816; b=Aymmj9SlOG4XpcSprMjVsoTkXFoccrAUGi9/rJiOZgYC1SwKFrwxmmd3+dBvY24rJj g0SyIDZ48GXYOIy7zJZYCJqG8bPgubprTMqIov3+r7kQxPh0SRx4JuACJ79u2SVOUqww 09hNrnglXWnb0WVVZUyCHJ2PugkTjyku1ajS+4y2h3DSz9ioVuZcsdp7PSd4vpjjbIaw WZTtBwx2Ch6MUFqGLkqypVVypxMgsAKZytNohGG8ja4TQkbxr/xUUMLo/TXX1uG9jxnf 8XdfFgkaYvg2c05vI6VcHBTXlTRu2wHNqS7YhRj6Lyi9ADYvrlKTcgxMWD03+u5iJXRR uFUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HQqsHP2Dch/+MMnMHvEsTt40LqVZM8h2XtzGgJE1mMA=; b=AwPTwIPAF3Yg3V1Xn5G+Y1w7uEMKTSoSGzYbIjJ79azmT7LRPJiYVoO/bGAcJMh9jW WF6Juw8ALyadMDwZiu67wBcnqo7TWcmZyqHfxxFg6azqBZcNbq+jWeueC1jOU148gE1i +1zhqJQUe7d27jbayPI7zEYc60mka+4kYHAp9OeLI8OpiiHeAt529wzg3DU4e0fH+XOs c/zuXZIt8hHA9FgRQ2CXXcYpNCWrKZ07u0UTHzdC/RlsRz/5KCJhzZ3PHY0PsxawmCp+ zj8Idi0OI4KKFqEcb2BP1ZoFcf59VCT537emUEM1dxgkIUxNoxqvLRySFMfqvPA6648A pymw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Ehem25LI; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e96si19781292plb.123.2019.05.28.09.32.14; Tue, 28 May 2019 09:32:37 -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=@oracle.com header.s=corp-2018-07-02 header.b=Ehem25LI; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbfE1Qa7 (ORCPT + 99 others); Tue, 28 May 2019 12:30:59 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:41272 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbfE1Qa7 (ORCPT ); Tue, 28 May 2019 12:30:59 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4SGSqLD165919; Tue, 28 May 2019 16:30:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=HQqsHP2Dch/+MMnMHvEsTt40LqVZM8h2XtzGgJE1mMA=; b=Ehem25LI9rEryKwf4rBZ011znJfXqOsPCd2LiprEaJA+kEiOk4XMCvuYfvQhBzaO7/9T 4tH487f8vtr57f98UXIJMxargkVycTv8TCPi3OSWIqRr5W8s9BHGh5HSq1ALGSupM5vs ieq6ERpMWF7aPhJUGlrvjsRYnpNJS0WJtS+Mh/o0NzhmWZeUZCf+IiD55cPgbs7Pgnq3 ls9JREHlwRYa1G7IzlwD0m1lEIIw/15eyY8WKQH2RhHzyX4T5d911w9rXHYFawY1f/zd 29HaqLP3qiPCynGZs1Zb4LV/BstnmV3wvMlNBFizxqnixMs3U9iKtFqnVvT1RjRond/i HA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2spw4tcev7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 May 2019 16:30:23 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4SGULxg170997; Tue, 28 May 2019 16:30:23 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2sqh7378da-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 May 2019 16:30:22 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4SGUMGw009191; Tue, 28 May 2019 16:30:22 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 May 2019 09:30:22 -0700 Date: Tue, 28 May 2019 09:30:20 -0700 From: "Darrick J. Wong" To: Amir Goldstein Cc: Dave Chinner , Christoph Hellwig , Olga Kornievskaia , Luis Henriques , Al Viro , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-api@vger.kernel.org, Dave Chinner Subject: Re: [PATCH v2 6/8] vfs: copy_file_range should update file timestamps Message-ID: <20190528163020.GF5221@magnolia> References: <20190526061100.21761-1-amir73il@gmail.com> <20190526061100.21761-7-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190526061100.21761-7-amir73il@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9270 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905280105 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9270 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905280105 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, May 26, 2019 at 09:10:57AM +0300, Amir Goldstein wrote: > From: Dave Chinner > > Timestamps are not updated right now, so programs looking for > timestamp updates for file modifications (like rsync) will not > detect that files have changed. We are also accessing the source > data when doing a copy (but not when cloning) so we need to update > atime on the source file as well. > > Signed-off-by: Dave Chinner > Signed-off-by: Amir Goldstein > --- > fs/read_write.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/fs/read_write.c b/fs/read_write.c > index e16bcafc0da2..4b23a86aacd9 100644 > --- a/fs/read_write.c > +++ b/fs/read_write.c > @@ -1576,6 +1576,16 @@ int generic_copy_file_range_prep(struct file *file_in, struct file *file_out) > > WARN_ON_ONCE(!inode_is_locked(file_inode(file_out))); > > + /* Update source timestamps, because we are accessing file data */ > + file_accessed(file_in); > + > + /* Update destination timestamps, since we can alter file contents. */ > + if (!(file_out->f_mode & FMODE_NOCMTIME)) { > + ret = file_update_time(file_out); > + if (ret) > + return ret; > + } > + > /* > * Clear the security bits if the process is not being run by root. > * This keeps people from modifying setuid and setgid binaries. Should the file_update_time and file_remove_privs calls be factored into a separate small function to be called by generic_{copy,remap}_range_prep? Looks ok otherwise, Reviewed-by: Darrick J. Wong --D > -- > 2.17.1 >