]> git.hungrycats.org Git - linux/commitdiff
Btrfs: warn_on for unaccounted spaces
authorJosef Bacik <jbacik@fb.com>
Tue, 22 Sep 2015 15:29:54 +0000 (11:29 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 30 Sep 2015 15:31:27 +0000 (11:31 -0400)
These were hidden behind enospc_debug, which isn't helpful as they indicate
actual bugs, unlike the rest of the enospc_debug stuff which is really debug
information.  Thanks,Btrfs: warn_on for unaccounted spaces

These were hidden behind enospc_debug, which isn't helpful as they indicate
actual bugs, unlike the rest of the enospc_debug stuff which is really debug
information.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
(cherry picked from commit ea67b575b6cd2be0775ddd1ff66968d11288f2c6)

fs/btrfs/extent-tree.c

index 825e256416b00695b52228fdb4f0a648b1c258e8..b25fff304ff7c38e75c0209424b246df28a348d9 100644 (file)
@@ -9215,13 +9215,15 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
                space_info = list_entry(info->space_info.next,
                                        struct btrfs_space_info,
                                        list);
-               if (btrfs_test_opt(info->tree_root, ENOSPC_DEBUG)) {
-                       if (WARN_ON(space_info->bytes_pinned > 0 ||
+
+               /*
+                * Do not hide this behind enospc_debug, this is actually
+                * important and indicates a real bug if this happens.
+                */
+               if (WARN_ON(space_info->bytes_pinned > 0 ||
                            space_info->bytes_reserved > 0 ||
-                           space_info->bytes_may_use > 0)) {
-                               dump_space_info(space_info, 0, 0);
-                       }
-               }
+                           space_info->bytes_may_use > 0))
+                       dump_space_info(space_info, 0, 0);
                list_del(&space_info->list);
                for (i = 0; i < BTRFS_NR_RAID_TYPES; i++) {
                        struct kobject *kobj;