Commit 1987fd74 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Dave Chinner

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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reported-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 9780643c
......@@ -1034,9 +1034,9 @@ xfs_ioctl_setattr_xflags(
return -EINVAL;
}
/* Don't allow us to set realtime mode for a reflinked file. */
/* Clear reflink if we are actually able to set the rt flag. */
if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip))
return -EINVAL;
ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;
/* Don't allow us to set DAX mode for a reflinked file for now. */
if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment