]> git.hungrycats.org Git - linux/commitdiff
zygo: btrfs: reloc_root might be NULL, adapt, #2
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 3 Dec 2019 18:08:47 +0000 (13:08 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 3 Dec 2019 21:41:32 +0000 (16:41 -0500)
(cherry picked from commit 3acb2fb64807af3fddc5a5bccb86449b6d2bbac3)

fs/btrfs/transaction.c

index de08349247379fd5dc15e3f11420e6d2b8b7d267..f1ff723483d27a8b12abebf36a490576c1a8cdad 100644 (file)
@@ -1555,8 +1555,9 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
        }
 
        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 = btrfs_reloc_post_snapshot(trans, pending);
        if (ret) {
                btrfs_abort_transaction(trans, ret);