From: Christoph Hellwig Date: Fri, 25 Oct 2019 05:26:27 +0000 (-0700) Subject: xfs: disable xfs_ioc_space for always COW inodes X-Git-Tag: v5.10.7~3672^2~155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a42c70ea0dd56b3ed747c1fcf9b96cc26c77774;p=platform%2Fkernel%2Flinux-rpi.git xfs: disable xfs_ioc_space for always COW inodes If we always have to write out of place preallocating blocks is pointless. We already check for this in the normal falloc path, but the check was missig in the legacy ALLOCSP path. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index e897d53..287f83e 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -33,6 +33,7 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_health.h" +#include "xfs_reflink.h" #include #include @@ -606,6 +607,9 @@ xfs_ioc_space( if (!S_ISREG(inode->i_mode)) return -EINVAL; + if (xfs_is_always_cow_inode(ip)) + return -EOPNOTSUPP; + if (filp->f_flags & O_DSYNC) flags |= XFS_PREALLOC_SYNC; if (filp->f_mode & FMODE_NOCMTIME)