From: Zygo Blaxell Date: Tue, 3 Dec 2019 18:08:47 +0000 (-0500) Subject: zygo: btrfs: reloc_root might be NULL, adapt, #2 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0dc6bb8b6de94dcad26e9c6a58d6287b95fc8b2;p=linux zygo: btrfs: reloc_root might be NULL, adapt, #2 (cherry picked from commit 3acb2fb64807af3fddc5a5bccb86449b6d2bbac3) --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index a59eb7db5975..9f0b1b045cc5 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1639,8 +1639,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);