]> 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, 7 Dec 2019 01:12:43 +0000 (20:12 -0500)
(cherry picked from commit 33ef2d3ce4c1830291a9bcbee499230b1d5937e8)

fs/btrfs/transaction.c

index c074e9975c053a326fd5c88c9f2d21d1a413d80a..a59eb7db597569a529abc81fe7fba4056b3fcf14 100644 (file)
@@ -1733,8 +1733,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;