]> git.hungrycats.org Git - linux/commitdiff
btrfs: scrub: allocate stripe buffer with GFP_KERNEL
authorFilipe Manana <fdmanana@suse.com>
Fri, 16 Oct 2026 11:55:55 +0000 (12:55 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:17 +0000 (21:36 +0100)
In init_scrub_stripe() we are allocating a stripe's buffer with GFP_NOFS
but we can use GFP_KERNEL instead since we are not holding a transaction
handle or any locks that could cause a deadlock if GFP_KERNEL triggers a
transaction commit.

So switch to GFP_KERNEL. We are also doing GFP_KERNEL for the allocation
of stripe->csums just a few lines below.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c

index 7c2cb75b685ca766c0dd3dcb8b4424bc9c4dcf78..5434a613f39349034b0b1c1dc33f5242a0748202 100644 (file)
@@ -356,7 +356,7 @@ static int init_scrub_stripe(struct btrfs_fs_info *fs_info,
        atomic_set(&stripe->pending_io, 0);
        spin_lock_init(&stripe->write_error_lock);
 
-       stripe->buffer = kvmalloc(BTRFS_STRIPE_LEN, GFP_NOFS);
+       stripe->buffer = kvmalloc(BTRFS_STRIPE_LEN, GFP_KERNEL);
        if (!stripe->buffer)
                goto error;