From: Zygo Blaxell Date: Tue, 3 Dec 2019 17:42:58 +0000 (-0500) Subject: zygo: btrfs: reloc_root might be NULL, adapt X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4127d54b74e718cd5a601af70bc9bef5a79c5939;p=linux zygo: btrfs: reloc_root might be NULL, adapt (cherry picked from commit 33ef2d3ce4c1830291a9bcbee499230b1d5937e8) --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 1ed49b63d7d2..c3126807bffc 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1731,8 +1731,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;