]> git.hungrycats.org Git - linux/commitdiff
zygo: btrfs: reloc_root might be NULL, adapt
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 3 Dec 2019 17:42:58 +0000 (12:42 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 14 Dec 2019 04:53:06 +0000 (23:53 -0500)
(cherry picked from commit 33ef2d3ce4c1830291a9bcbee499230b1d5937e8)

fs/btrfs/transaction.c

index 1ed49b63d7d271b7f40e8e63f795a5c1e2f712a0..c3126807bffcd5f527a7d217840e5bc8e273fec7 100644 (file)
@@ -1731,8 +1731,9 @@ static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans)
        list_for_each_entry_safe(pending, next, head, list) {
                list_del(&pending->list);
                WARN_ON(!pending->root);
-               WARN_ON(!pending->root->reloc_root);
-               WARN_ON(!pending->root->reloc_root->node);
+               if (pending->root->reloc_root) {
+                       WARN_ON(!pending->root->reloc_root->node);
+               }
                ret = create_pending_snapshot(trans, pending);
                if (ret)
                        break;