On Thu, Dec 03, 2020 at 04:19:35PM -0600, Eric Sandeen wrote: > On 12/3/20 3:44 PM, Darrick J. Wong wrote: > > On Tue, Dec 01, 2020 at 01:16:09PM -0600, Eric Sandeen wrote: > >> We don't yet support dax on reflinked files, but that is in the works. > >> > >> Further, having the flag set does not automatically mean that the inode > >> is actually "in the CPU direct access state," which depends on several > >> other conditions in addition to the flag being set. > >> > >> As such, we should not catch this as corruption in the verifier - simply > >> not actually enabling S_DAX on reflinked files is enough for now. > >> > >> Fixes: 4f435ebe7d04 ("xfs: don't mix reflink and DAX mode for now") > >> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx> > >> --- > >> fs/xfs/libxfs/xfs_inode_buf.c | 4 ---- > >> 1 file changed, 4 deletions(-) > >> > >> diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > >> index c667c63f2cb0..4d7410e49db4 100644 > >> --- a/fs/xfs/libxfs/xfs_inode_buf.c > >> +++ b/fs/xfs/libxfs/xfs_inode_buf.c > >> @@ -547,10 +547,6 @@ xfs_dinode_verify( > >> if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags & XFS_DIFLAG_REALTIME)) > >> return __this_address; > >> > >> - /* don't let reflink and dax mix */ > >> - if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags2 & XFS_DIFLAG2_DAX)) > >> - return __this_address; > > > > If we're going to let in inodes with the DAX and REFLINK iflags set, > > doesn't that mean that xfs_inode_should_enable_dax needs to return false > > if REFLINK is set? > > I think it does already, no? > > static bool > xfs_inode_should_enable_dax( > struct xfs_inode *ip) > { > if (!IS_ENABLED(CONFIG_FS_DAX)) > return false; > if (ip->i_mount->m_flags & XFS_MOUNT_DAX_NEVER) > return false; > if (!xfs_inode_supports_dax(ip)) <------ > return false; > > > ----> xfs_inode_supports_dax ---> > > static bool > xfs_inode_supports_dax( > struct xfs_inode *ip) > { > struct xfs_mount *mp = ip->i_mount; > > /* Only supported on regular files. */ > if (!S_ISREG(VFS_I(ip)->i_mode)) > return false; > > /* Only supported on non-reflinked files. */ > if (xfs_is_reflink_inode(ip)) > return false; > DOH yes it does, Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --D