summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/block-group.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2024-01-12 18:45:24 +0100
committerDavid Sterba <dsterba@suse.com>2024-03-04 16:24:46 +0100
commit44a6c3437afc7e6fbea090bf3ab98ef751ad2ede (patch)
treedbd6e158032cf89f2ea737b12682c604f2e0a5f6 /fs/btrfs/block-group.c
parentc03c89f821e51325d0e592cf625cf5e0a26fa3a7 (diff)
downloadlinux-44a6c3437afc7e6fbea090bf3ab98ef751ad2ede.tar.gz
linux-44a6c3437afc7e6fbea090bf3ab98ef751ad2ede.tar.bz2
linux-44a6c3437afc7e6fbea090bf3ab98ef751ad2ede.zip
btrfs: return errors from unpin_extent_range()
Handle the lookup failure of the block group to unpin, this is a logic error as the block group must exist at this point. If not, something else must have freed it, like clean_pinned_extents() would do without locking the unused_bg_unpin_mutex. Push the errors to the callers, proper handling will be done in followup patches. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-group.c')
-rw-r--r--fs/btrfs/block-group.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 378d9103a207..e9e455fd528a 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1429,7 +1429,7 @@ static bool clean_pinned_extents(struct btrfs_trans_handle *trans,
* group in pinned_extents before we were able to clear the whole block
* group range from pinned_extents. This means that task can lookup for
* the block group after we unpinned it from pinned_extents and removed
- * it, leading to a BUG_ON() at unpin_extent_range().
+ * it, leading to an error at unpin_extent_range().
*/
mutex_lock(&fs_info->unused_bg_unpin_mutex);
if (prev_trans) {