diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-09-19 16:06:34 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-29 17:08:30 +0200 |
commit | ad5d6e9148b6774625149dc4dece0e54f3e7f7c9 (patch) | |
tree | ebe9be0ec4acd317d1f4d520782b5ef0c909a679 /fs/btrfs | |
parent | btrfs: add helper to replace extent map range with a new extent map (diff) | |
download | linux-ad5d6e9148b6774625149dc4dece0e54f3e7f7c9.tar.xz linux-ad5d6e9148b6774625149dc4dece0e54f3e7f7c9.zip |
btrfs: remove the refcount warning/check at free_extent_map()
At free_extent_map(), it's pointless to have a WARN_ON() to check if the
refcount of the extent map is zero. Such check is already done by the
refcount_t module and refcount_dec_and_test(), which loudly complains if
we try to decrement a reference count that is currently 0.
The WARN_ON() dates back to the time when used a regular atomic_t type
for the reference counter, before we switched to the refcount_t type.
The main goal of the refcount_t type/module is precisely to catch such
types of bugs and loudly complain if they happen.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_map.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index bef9cc8bfb2a..2e6dc5a772f4 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -74,7 +74,6 @@ void free_extent_map(struct extent_map *em) { if (!em) return; - WARN_ON(refcount_read(&em->refs) == 0); if (refcount_dec_and_test(&em->refs)) { WARN_ON(extent_map_in_tree(em)); WARN_ON(!list_empty(&em->list)); |