]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: drop NOFAIL from set_extent_bit allocation masks
authorDavid Sterba <dsterba@suse.com>
Wed, 24 May 2023 23:04:34 +0000 (01:04 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:30 +0000 (13:59 +0200)
The __GFP_NOFAIL passed to set_extent_bit first appeared in 2010
(commit f0486c68e4bd9a ("Btrfs: Introduce contexts for metadata
reservation")), without any explanation why it would be needed.

Meanwhile we've updated the semantics of set_extent_bit to handle failed
allocations and do unlock, sleep and retry if needed.  The use of the
NOFAIL flag is also an outlier, we never want any of the set/clear
extent bit helpers to fail, they're used for many critical changes like
extent locking, besides the extent state bit changes.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/extent-tree.c

index ec463f8d83ecfd28e281cbb770399a858bfb4339..202e2aa949c5343d9e5fa64e8e8fae022a6dcb1c 100644 (file)
@@ -3523,8 +3523,7 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans,
 
                        set_extent_bit(&trans->transaction->pinned_extents,
                                       bytenr, bytenr + num_bytes - 1,
-                                      EXTENT_DIRTY, NULL,
-                                      GFP_NOFS | __GFP_NOFAIL);
+                                      EXTENT_DIRTY, NULL, GFP_NOFS);
                }
 
                spin_lock(&trans->transaction->dirty_bgs_lock);
index 03b2a7c508b96216d521f24341ed63c649a8a2cd..6e319100e3a3a980ae792ce47f86204cdc767093 100644 (file)
@@ -2508,8 +2508,7 @@ static int pin_down_extent(struct btrfs_trans_handle *trans,
        spin_unlock(&cache->space_info->lock);
 
        set_extent_bit(&trans->transaction->pinned_extents, bytenr,
-                      bytenr + num_bytes - 1, EXTENT_DIRTY, NULL,
-                      GFP_NOFS | __GFP_NOFAIL);
+                      bytenr + num_bytes - 1, EXTENT_DIRTY, NULL, GFP_NOFS);
        return 0;
 }