From: Liu Bo Date: Fri, 18 Aug 2017 21:15:22 +0000 (-0600) Subject: Btrfs: remove BUG() in add_data_reference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b14c55a191263889c379aeee85223bb72501824d;p=openwrt%2Fstaging%2Fblogic.git Btrfs: remove BUG() in add_data_reference Now that we have a helper to report invalid value of extent inline ref type, we need to quit gracefully instead of throwing out a kernel panic. Signed-off-by: Liu Bo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 96f816aa9ed3..1c086d0667be 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3772,7 +3772,10 @@ int add_data_references(struct reloc_control *rc, ret = find_data_references(rc, extent_key, eb, dref, blocks); } else { - BUG(); + ret = -EINVAL; + btrfs_err(rc->extent_root->fs_info, + "extent %llu slot %d has an invalid inline ref type", + eb->start, path->slots[0]); } if (ret) { err = ret;