linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: relatime update - Match comment with behavior
@ 2019-06-11  5:45 Aurelien Thierry
  2019-06-18  1:12 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Thierry @ 2019-06-11  5:45 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Aurelien Thierry, linux-fsdevel, trivial

2 comments right before code wrongly state that if (c|m)time is younger
than atime, then atime is updated (behavior is the other way around).

Fix aligns comments with actual behavior, function description and
documentation (man mount).

Signed-off-by: Aurelien Thierry <aurelien.thierry@quoscient.io>
---
 fs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index df6542ec3b88..1e5489288aa9 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1620,12 +1620,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 atime earlier than mtime? 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 atime earlier than ctime? If yes, update atime:
 	 */
 	if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0)
 		return 1;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-11  5:45 [PATCH] fs: relatime update - Match comment with behavior Aurelien Thierry
2019-06-18  1:12 ` Al Viro
2019-06-18 11:43   ` Aurelien Thierry

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).