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=d177b2ac8e4f8e8564237176404b5f3f873fe0fd;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 c3126807bffc..506d727f4172 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1637,8 +1637,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);