Before support for the per-inode DAX flag was disabled the XFS the code hadan issue where the user couldn't reliably tell whether or not DAX was beingused to service page faults and I/O when the DAX mount option was used. Inthis case each inode within the mounted filesystem started with S_DAX setdue to the mount option, but it could be cleared if someone touched theindividual inode flag.

We end up with both /mnt/a and /mnt/b looking identical from the point ofview of the mount option and from lsattr, but one is using DAX and theother is not.

Fix this by always doing DAX I/O when either the mount option is set orwhen the DAX inode flag is set. This means that DAX will always be usedfor all inodes on a filesystem mounted with -o dax, making the usagereliable and detectable.

This does not fix the race issues that caused the XFS DAX inode option tobe disabled, so that option will still be disabled. If/when we re-enableit, though, I think we will want this issue to have been fixed. I also dothink that we want to fix this in stable kernels.

- /* If the DAX state is not changing, we have nothing to do here. */+ /*+ * If the DAX state is not changing, we have nothing to do here. If+ * the DAX mount option was used we will update the DAX inode flag as+ * the user requested but we will continue to use DAX for I/O and page+ * faults regardless of how the inode flag is set.+ */+ if (ip->i_mount->m_flags & XFS_MOUNT_DAX)+ return 0; if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) return 0; if (!(fa->fsx_xflags & FS_XFLAG_DAX) && !IS_DAX(inode))-- 2.9.5