Skip to content

Commit

Permalink
xfs: clear reflink flag if setting realtime flag
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Brian Foster <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
  • Loading branch information
djwong authored and dchinner committed Oct 10, 2016
1 parent 9780643 commit 1987fd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/xfs/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1987fd7

Please sign in to comment.