Skip to content

Commit 983d8e6

Browse files
author
Darrick J. Wong
committed
xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at the end of files, just like fallocate and RESVSP. Make the behavior consistent with the other ioctls. Reported-by: Kirill Tkhai <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
1 parent 2585cf9 commit 983d8e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/xfs/xfs_ioctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ xfs_ioc_space(
687687

688688
if (bf->l_start > XFS_ISIZE(ip)) {
689689
error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
690-
bf->l_start - XFS_ISIZE(ip), 0);
690+
bf->l_start - XFS_ISIZE(ip),
691+
XFS_BMAPI_PREALLOC);
691692
if (error)
692693
goto out_unlock;
693694
}

0 commit comments

Comments
 (0)