aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 12:11:50 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2016-10-05 19:26:31 -0400
commit4f435ebe7d0422af61cdcddbbcc659888645a1e1 (patch)
tree49f6833f8b5b9e71c2df1b540fcbe933dfcd7087
parentc8e156ac336d82f67d7adc014404a2251e9dad09 (diff)
xfs: don't mix reflink and DAX mode for now
Since we don't have a strategy for handling both DAX and reflink, for now we'll just prohibit both being set at the same time. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c4
-rw-r--r--fs/xfs/xfs_file.c4
-rw-r--r--fs/xfs/xfs_ioctl.c4
-rw-r--r--fs/xfs/xfs_iops.c1
4 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index f1b9d97c540f..8de9a3a29589 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -407,6 +407,10 @@ xfs_dinode_verify(
407 if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags & XFS_DIFLAG_REALTIME)) 407 if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags & XFS_DIFLAG_REALTIME))
408 return false; 408 return false;
409 409
410 /* don't let reflink and dax mix */
411 if ((flags2 & XFS_DIFLAG2_REFLINK) && (flags2 & XFS_DIFLAG2_DAX))
412 return false;
413
410 return true; 414 return true;
411} 415}
412 416
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 0726df88bce2..54c27edb74bc 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1055,6 +1055,10 @@ xfs_file_share_range(
1055 if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode)) 1055 if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
1056 return -EINVAL; 1056 return -EINVAL;
1057 1057
1058 /* Don't share DAX file data for now. */
1059 if (IS_DAX(inode_in) || IS_DAX(inode_out))
1060 return -EINVAL;
1061
1058 /* Are we going all the way to the end? */ 1062 /* Are we going all the way to the end? */
1059 isize = i_size_read(inode_in); 1063 isize = i_size_read(inode_in);
1060 if (isize == 0) 1064 if (isize == 0)
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index c65d9eacf54d..8b9f31c54c1e 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1038,6 +1038,10 @@ xfs_ioctl_setattr_xflags(
1038 if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip)) 1038 if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip))
1039 return -EINVAL; 1039 return -EINVAL;
1040 1040
1041 /* Don't allow us to set DAX mode for a reflinked file for now. */
1042 if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
1043 return -EINVAL;
1044
1041 /* 1045 /*
1042 * Can't modify an immutable/append-only file unless 1046 * Can't modify an immutable/append-only file unless
1043 * we have appropriate permission. 1047 * we have appropriate permission.
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index b24c3102fa93..5945b64f77cc 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -1144,6 +1144,7 @@ xfs_diflags_to_iflags(
1144 inode->i_flags |= S_NOATIME; 1144 inode->i_flags |= S_NOATIME;
1145 if (S_ISREG(inode->i_mode) && 1145 if (S_ISREG(inode->i_mode) &&
1146 ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE && 1146 ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE &&
1147 !xfs_is_reflink_inode(ip) &&
1147 (ip->i_mount->m_flags & XFS_MOUNT_DAX || 1148 (ip->i_mount->m_flags & XFS_MOUNT_DAX ||
1148 ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) 1149 ip->i_d.di_flags2 & XFS_DIFLAG2_DAX))
1149 inode->i_flags |= S_DAX; 1150 inode->i_flags |= S_DAX;