]> 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>
Tue, 3 Dec 2019 21:41:27 +0000 (16:41 -0500)
(cherry picked from commit 33ef2d3ce4c1830291a9bcbee499230b1d5937e8)

fs/btrfs/transaction.c

index af4234ca8b1c57edbf4da089d006fce4694f7094..de08349247379fd5dc15e3f11420e6d2b8b7d267 100644 (file)
@@ -1649,8 +1649,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;