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:

http://lwn.net/Articles/245002/   that suggested that noatime includes nodiratime

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

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