Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2052733ybc; Sun, 24 Nov 2019 11:53:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwh/i94vX2IqqnYrOeCG5GD4IbAkA/fMYFm4sg9O/tWfMLtv0hWPHQrbaMYlNQ7EHRrkyYu X-Received: by 2002:aa7:cf97:: with SMTP id z23mr14343956edx.245.1574625187961; Sun, 24 Nov 2019 11:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574625187; cv=none; d=google.com; s=arc-20160816; b=ficjPdECS6NFhJswbXt1BHmr+RT5gxKQgYyPQoEPfvq4WB7edH8ZG0+VDcbXrXBSHB /nlns929KaxhyAEqDIspVzQCmSwrhzbFdwsbnQKQkmKOzGcpiTBwidfOXdDUzpTN6LnH 8cdpq/h6iecHY9uKwb2kk5OvqYj896aWXYPN6V0WB4H/BLGd/AsFfyJTJ55H6P+rzZGf oYkPjoU9tA9EM4Dz2hnz5pXpUe2ArjJsoP0CGpy73BEBfGQvDMTXqbsZHOjRgGYhB5O7 OZet/Gp4dvwh7xONpiONrycSdNPA7qMX8kP88KgQV+Rnu/uNpTKz6TgQZvv3RB+dzSGN 4RBQ== 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; bh=10g5WXH4p2yOPU9yLfp1WGZt9c4bwNUCXvk+B9iEqBw=; b=NX2XlOjxU4iaUbUF9QgebSRBtzUokKY2oNql0VuHhojHoTz3WAamJGhVA2fQSq0nA1 qtQv53/Xm3I/cwyQlnqIXLc22M1DYtqTsZ7XAgsD5tCrLJSW6AaJn/P07iUPyq5xxIZ+ UnSYVnG/7Fob9ijKsqnZ4OaZL3cdqJ7Uakyiq2u8dpFzl7m/oAl3AUdjVe6r1J811gjw CKvCihDRnxT6ugIT77QN1xM44SwqE6c6DCm6JvlzQ9zZ/+YU8qwWK12VY7PDgyuUgYb3 5mtEIg7e8kaE3jNzE4Wfr3iJ0sd9LRdzNpe5qy2vpG7jGOuEbWxsdc8N3W3Z7DGCWowQ ku7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mh1si3062536ejb.221.2019.11.24.11.52.36; Sun, 24 Nov 2019 11:53:07 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfKXTtl (ORCPT + 99 others); Sun, 24 Nov 2019 14:49:41 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:51540 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbfKXTtk (ORCPT ); Sun, 24 Nov 2019 14:49:40 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iYxt0-0005eu-Q9; Sun, 24 Nov 2019 19:49:34 +0000 Date: Sun, 24 Nov 2019 19:49:34 +0000 From: Al Viro To: Amir Goldstein Cc: Arnd Bergmann , Deepa Dinamani , Jeff Layton , "J . Bruce Fields" , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-nfs@vger.kernel.org, y2038@lists.linaro.org Subject: Re: [PATCH] utimes: Clamp the timestamps in notify_change() Message-ID: <20191124194934.GB4203@ZenIV.linux.org.uk> References: <20191124193145.22945-1-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191124193145.22945-1-amir73il@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, Nov 24, 2019 at 09:31:45PM +0200, Amir Goldstein wrote: > Push clamping timestamps down the call stack into notify_change(), so > in-kernel callers like nfsd and overlayfs will get similar timestamp > set behavior as utimes. Makes sense; said that, shouldn't we go through ->setattr() instances and get rid of that there, now that notify_change() is made to do it? I mean, if (ia_valid & ATTR_ATIME) sd_iattr->ia_atime = timestamp_truncate(iattr->ia_atime, inode); in configfs_setattr() looks like it should be reverted to if (ia_valid & ATTR_ATIME) sd_iattr->ia_atime = iattr->ia_atime; with that, etc. Moreover, does that leave any valid callers of timestamp_truncate() outside of notify_change() and current_time()? IOW, is there any point having it exported? Look: fs/attr.c:187: inode->i_atime = timestamp_truncate(attr->ia_atime, fs/attr.c:191: inode->i_mtime = timestamp_truncate(attr->ia_mtime, fs/attr.c:195: inode->i_ctime = timestamp_truncate(attr->ia_ctime, setattr_copy(), called downstream of your changes. fs/configfs/inode.c:79: sd_iattr->ia_atime = timestamp_truncate(iattr->ia_atime, fs/configfs/inode.c:82: sd_iattr->ia_mtime = timestamp_truncate(iattr->ia_mtime, fs/configfs/inode.c:85: sd_iattr->ia_ctime = timestamp_truncate(iattr->ia_ctime, configfs_setattr(); ditto. fs/f2fs/file.c:755: inode->i_atime = timestamp_truncate(attr->ia_atime, fs/f2fs/file.c:759: inode->i_mtime = timestamp_truncate(attr->ia_mtime, fs/f2fs/file.c:763: inode->i_ctime = timestamp_truncate(attr->ia_ctime, __setattr_copy() from f2fs_setattr(); ditto. fs/inode.c:2224: return timestamp_truncate(now, inode); current_time() fs/kernfs/inode.c:163: inode->i_atime = timestamp_truncate(attrs->ia_atime, inode); fs/kernfs/inode.c:164: inode->i_mtime = timestamp_truncate(attrs->ia_mtime, inode); fs/kernfs/inode.c:165: inode->i_ctime = timestamp_truncate(attrs->ia_ctime, inode); ->s_time_max and ->s_time_min are left TIME64_MAX and TIME64_MIN resp., so timestamp_truncate() should be a no-op there. fs/ntfs/inode.c:2903: vi->i_atime = timestamp_truncate(attr->ia_atime, fs/ntfs/inode.c:2907: vi->i_mtime = timestamp_truncate(attr->ia_mtime, fs/ntfs/inode.c:2911: vi->i_ctime = timestamp_truncate(attr->ia_ctime, ntfs_setattr(); downstream from your changes fs/ubifs/file.c:1082: inode->i_atime = timestamp_truncate(attr->ia_atime, fs/ubifs/file.c:1086: inode->i_mtime = timestamp_truncate(attr->ia_mtime, fs/ubifs/file.c:1090: inode->i_ctime = timestamp_truncate(attr->ia_ctime, do_attr_changes(), from do_truncation() or do_setattr(), both from ubifs_setattr(); ditto. fs/utimes.c:39: newattrs.ia_atime = timestamp_truncate(times[0], inode); fs/utimes.c:46: newattrs.ia_mtime = timestamp_truncate(times[1], inode); disappears in your patch.