nodiratime AND noatime?

I once saw a recommendation to mount using nodiratime AND noatime like this:

mount -t xfs /dev/md0 /mysql_data -o nobarrier,noatime,nodiratime

But then I looked into it further and found this:   that suggested that noatime includes nodiratime

void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
        /* ... */
        if (inode->i_flags & S_NOATIME)
        if (IS_NOATIME(inode))
        if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))

So if NOATIME is set, the NODIRATIME flag is never even checked.

so this is good enough:

mount -t xfs /dev/md0 /mysql_data -o nobarrier,noatime

Posted in Linux, MySQL

Leave a Reply