linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	Jeff Layton <jlayton@kernel.org>,
	"J . Bruce Fields" <bfields@fieldses.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	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()
Date: Sun, 24 Nov 2019 19:49:34 +0000	[thread overview]
Message-ID: <20191124194934.GB4203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20191124193145.22945-1-amir73il@gmail.com>

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.

  reply	other threads:[~2019-11-24 19:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 19:31 [PATCH] utimes: Clamp the timestamps in notify_change() Amir Goldstein
2019-11-24 19:49 ` Al Viro [this message]
2019-11-24 20:50   ` Amir Goldstein
2019-11-24 21:14     ` Deepa Dinamani
2019-11-24 21:13   ` Deepa Dinamani
2019-11-24 21:34     ` Al Viro
2019-11-30  5:34       ` Deepa Dinamani
2019-11-25 16:46 ` J . Bruce Fields
2019-11-25 17:35   ` Amir Goldstein
2019-11-25 18:16   ` Deepa Dinamani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191124194934.GB4203@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bfields@fieldses.org \
    --cc=deepa.kernel@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).