From: Mark Fasheh Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and to test against mtime / ctime accordingly. Signed-off-by: Mark Fasheh Cc: Valerie Henson Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/ocfs2/file.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff -puN fs/ocfs2/file.c~ocfs2-relative-atime-support fs/ocfs2/file.c --- a/fs/ocfs2/file.c~ocfs2-relative-atime-support +++ a/fs/ocfs2/file.c @@ -154,6 +154,15 @@ int ocfs2_should_update_atime(struct ino return 0; now = CURRENT_TIME; + + if (vfsmnt->mnt_flags & MNT_RELATIME) { + if ((timespec_compare(&inode->i_atime, &inode->i_mtime) < 0) || + (timespec_compare(&inode->i_atime, &inode->i_ctime) < 0)) + return 1; + + return 0; + } + if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) return 0; else _