aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-10 01:49:29 -0400
committerDave Chinner <david@fromorbit.com>2016-10-10 01:49:29 -0400
commit1987fd743415564e8c67f2f7ec0ae3c18a6b11cd (patch)
tree90cefba2ca90369248f60518808ab14b7dcd27be
parent9780643cde26406d324413ae5c51e772144533bc (diff)
xfs: clear reflink flag if setting realtime flag
Since we can only turn on the rt flag if there are no data extents, we can safely turn off the reflink flag if the rt flag is being turned on. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reported-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/xfs_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 8b9f31c54c1e..598b97bb19da 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1034,9 +1034,9 @@ xfs_ioctl_setattr_xflags(
1034 return -EINVAL; 1034 return -EINVAL;
1035 } 1035 }
1036 1036
1037 /* Don't allow us to set realtime mode for a reflinked file. */ 1037 /* Clear reflink if we are actually able to set the rt flag. */
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 ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;
1040 1040
1041 /* Don't allow us to set DAX mode for a reflinked file for now. */ 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)) 1042 if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))