summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 09:11:50 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2016-10-05 16:26:31 -0700
commitc8e156ac336d82f67d7adc014404a2251e9dad09 (patch)
treead4439160ac5088574fa6984270ee2221438abb2 /fs/xfs/xfs_ioctl.c
parente153aa7990a09a8a12860fc1f79304b02a6bc03f (diff)
downloadtalos-op-linux-c8e156ac336d82f67d7adc014404a2251e9dad09.tar.gz
talos-op-linux-c8e156ac336d82f67d7adc014404a2251e9dad09.zip
xfs: check for invalid inode reflink flags
We don't support sharing blocks on the realtime device. Flag inodes with the reflink or cowextsize flags set when the reflink feature is disabled. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 1388a1275dc8..c65d9eacf54d 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1034,6 +1034,10 @@ xfs_ioctl_setattr_xflags(
return -EINVAL;
}
+ /* Don't allow us to set realtime mode for a reflinked file. */
+ if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip))
+ return -EINVAL;
+
/*
* Can't modify an immutable/append-only file unless
* we have appropriate permission.
OpenPOWER on IntegriCloud