Message ID | 20191025023609.22295-4-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] xfs: don't implement XFS_IOC_RESVSP / XFS_IOC_RESVSP64 directly | expand |
On Fri, Oct 25, 2019 at 11:36:08AM +0900, Christoph Hellwig wrote: > 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 <hch@lst.de> Looks ok, Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > --- > fs/xfs/xfs_ioctl.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > index 3fe1543f9f02..552034325991 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 <linux/mount.h> > #include <linux/namei.h> > @@ -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) > -- > 2.20.1 >
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 3fe1543f9f02..552034325991 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 <linux/mount.h> #include <linux/namei.h> @@ -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)
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 <hch@lst.de> --- fs/xfs/xfs_ioctl.c | 4 ++++ 1 file changed, 4 insertions(+)