Commit 7dde7a8a authored by David Sterba's avatar David Sterba

btrfs: drop NOFAIL from set_extent_bit allocation masks

The __GFP_NOFAIL passed to set_extent_bit first appeared in 2010
(commit f0486c68 ("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: default avatarDavid Sterba <dsterba@suse.com>
parent 0acd32c2
...@@ -3523,8 +3523,7 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans, ...@@ -3523,8 +3523,7 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans,
set_extent_bit(&trans->transaction->pinned_extents, set_extent_bit(&trans->transaction->pinned_extents,
bytenr, bytenr + num_bytes - 1, bytenr, bytenr + num_bytes - 1,
EXTENT_DIRTY, NULL, EXTENT_DIRTY, NULL, GFP_NOFS);
GFP_NOFS | __GFP_NOFAIL);
} }
spin_lock(&trans->transaction->dirty_bgs_lock); spin_lock(&trans->transaction->dirty_bgs_lock);
......
...@@ -2508,8 +2508,7 @@ static int pin_down_extent(struct btrfs_trans_handle *trans, ...@@ -2508,8 +2508,7 @@ static int pin_down_extent(struct btrfs_trans_handle *trans,
spin_unlock(&cache->space_info->lock); spin_unlock(&cache->space_info->lock);
set_extent_bit(&trans->transaction->pinned_extents, bytenr, set_extent_bit(&trans->transaction->pinned_extents, bytenr,
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL, bytenr + num_bytes - 1, EXTENT_DIRTY, NULL, GFP_NOFS);
GFP_NOFS | __GFP_NOFAIL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment