]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: use VM_NORESERVE in xfile_create
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Feb 2024 06:27:16 +0000 (07:27 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 21 Feb 2024 06:06:51 +0000 (11:36 +0530)
xfile_create creates a (potentially large) sparse file.  Pass
VM_NORESERVE to shmem_file_setup to not account for the entire file size
at file creation time.

Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/scrub/xfile.c

index 090c3ead43fdf1d244a053fb46a2831a8c39b9b6..1cf4b239bdbbd7cf362248a4cde388804d61dd3b 100644 (file)
@@ -68,7 +68,7 @@ xfile_create(
        if (!xf)
                return -ENOMEM;
 
-       xf->file = shmem_file_setup(description, isize, 0);
+       xf->file = shmem_file_setup(description, isize, VM_NORESERVE);
        if (!xf->file)
                goto out_xfile;
        if (IS_ERR(xf->file)) {