lkml.org 
[lkml]   [2022]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 07/14] xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
    Date
    From: Darrick J. Wong <djwong@kernel.org>

    commit 983d8e60f50806f90534cc5373d0ce867e5aaf79 upstream.

    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 <ktkhai@virtuozzo.com>
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: Eric Sandeen <sandeen@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    fs/xfs/xfs_ioctl.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/fs/xfs/xfs_ioctl.c
    +++ b/fs/xfs/xfs_ioctl.c
    @@ -729,7 +729,8 @@ xfs_ioc_space(
    flags |= XFS_PREALLOC_CLEAR;
    if (bf->l_start > XFS_ISIZE(ip)) {
    error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
    - bf->l_start - XFS_ISIZE(ip), 0);
    + bf->l_start - XFS_ISIZE(ip),
    + XFS_BMAPI_PREALLOC);
    if (error)
    goto out_unlock;
    }

    \
     
     \ /
      Last update: 2022-01-10 08:26    [W:4.026 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site