mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
Update relatime comments to include equality
relatime also updates atime if the previous atime is equal to one or both of the ctime and mtime; a non-strict interpretation of "earlier than" and "younger than" in the comments allows this, but for clarity, this makes it explicit. Pointed out by "epiii2" and "ctrl-alt-delor" in https://unix.stackexchange.com/q/740862/86440. Signed-off-by: Stephen Kitt <steve@sk2.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
dc7cb2d298
commit
d98ffa1aca
@ -1804,8 +1804,8 @@ EXPORT_SYMBOL(bmap);
|
||||
|
||||
/*
|
||||
* With relative atime, only update atime if the previous atime is
|
||||
* earlier than either the ctime or mtime or if at least a day has
|
||||
* passed since the last atime update.
|
||||
* earlier than or equal to either the ctime or mtime,
|
||||
* or if at least a day has passed since the last atime update.
|
||||
*/
|
||||
static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
|
||||
struct timespec64 now)
|
||||
@ -1814,12 +1814,12 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
|
||||
if (!(mnt->mnt_flags & MNT_RELATIME))
|
||||
return 1;
|
||||
/*
|
||||
* Is mtime younger than atime? If yes, update atime:
|
||||
* Is mtime younger than or equal to atime? If yes, update atime:
|
||||
*/
|
||||
if (timespec64_compare(&inode->i_mtime, &inode->i_atime) >= 0)
|
||||
return 1;
|
||||
/*
|
||||
* Is ctime younger than atime? If yes, update atime:
|
||||
* Is ctime younger than or equal to atime? If yes, update atime:
|
||||
*/
|
||||
if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0)
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user