mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
utimes: Clamp the timestamps in notify_change()
commit eb31e2f63d85d1bec4f7b136f317e03c03db5503 upstream.
Push clamping timestamps into notify_change(), so in-kernel
callers like nfsd and overlayfs will get similar timestamp
set behavior as utimes.
AV: get rid of clamping in ->setattr() instances; we don't need
to bother with that there, with notify_change() doing normalization
in all cases now (it already did for implicit case, since current_time()
clamps).
Suggested-by: Miklos Szeredi <[email protected]>
Fixes: 42e729b9dd ("utimes: Clamp the timestamps before update")
Cc: [email protected] # v5.4
Cc: Deepa Dinamani <[email protected]>
Cc: Jeff Layton <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
73031a617a
commit
cb33e477a5
6 changed files with 34 additions and 56 deletions
|
|
@ -76,14 +76,11 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
|
|||
if (ia_valid & ATTR_GID)
|
||||
sd_iattr->ia_gid = iattr->ia_gid;
|
||||
if (ia_valid & ATTR_ATIME)
|
||||
sd_iattr->ia_atime = timestamp_truncate(iattr->ia_atime,
|
||||
inode);
|
||||
sd_iattr->ia_atime = iattr->ia_atime;
|
||||
if (ia_valid & ATTR_MTIME)
|
||||
sd_iattr->ia_mtime = timestamp_truncate(iattr->ia_mtime,
|
||||
inode);
|
||||
sd_iattr->ia_mtime = iattr->ia_mtime;
|
||||
if (ia_valid & ATTR_CTIME)
|
||||
sd_iattr->ia_ctime = timestamp_truncate(iattr->ia_ctime,
|
||||
inode);
|
||||
sd_iattr->ia_ctime = iattr->ia_ctime;
|
||||
if (ia_valid & ATTR_MODE) {
|
||||
umode_t mode = iattr->ia_mode;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue