xfs: don't catch dax+reflink inodes as corruption in verifier
authorEric Sandeen <sandeen@redhat.com>
Wed, 9 Dec 2020 02:59:12 +0000 (18:59 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 Dec 2020 17:49:38 +0000 (09:49 -0800)
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@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
[darrick: fix the scrubber too]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/scrub/inode.c

index c667c63f2cb003cea791a158627b4bf76ca988c8..4d7410e49db41b93c8c77160d998bc6a8947f591 100644 (file)
@@ -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;
-
        /* COW extent size hint validation */
        fa = xfs_inode_validate_cowextsize(mp, be32_to_cpu(dip->di_cowextsize),
                        mode, flags, flags2);
index bb25ff1b770d12519a4419d907d1a63750787e0e..faf65eb5bd310311117c4fb5b5241d6e1059b813 100644 (file)
@@ -185,10 +185,6 @@ xchk_inode_flags2(
        if ((flags & XFS_DIFLAG_REALTIME) && (flags2 & XFS_DIFLAG2_REFLINK))
                goto bad;
 
-       /* dax and reflink make no sense, currently */
-       if ((flags2 & XFS_DIFLAG2_DAX) && (flags2 & XFS_DIFLAG2_REFLINK))
-               goto bad;
-
        /* no bigtime iflag without the bigtime feature */
        if (xfs_dinode_has_bigtime(dip) &&
            !xfs_sb_version_hasbigtime(&mp->m_sb))