From: David Sterba Date: Mon, 3 Feb 2014 18:24:19 +0000 (+0100) Subject: btrfs: send: remove BUG from process_all_refs X-Git-Tag: firefly_0821_release~176^2~3883^2~129 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4d1a63b21b4f77a82efe7d78fc1ae1cc7532691c;p=firefly-linux-kernel-4.4.55.git btrfs: send: remove BUG from process_all_refs There are only 2 static callers, the BUG would normally be never reached, but let's be nice. Signed-off-by: David Sterba Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 4405aae05281..d3ed9df77422 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -3606,7 +3606,10 @@ static int process_all_refs(struct send_ctx *sctx, root = sctx->parent_root; cb = __record_deleted_ref; } else { - BUG(); + btrfs_err(sctx->send_root->fs_info, + "Wrong command %d in process_all_refs", cmd); + ret = -EINVAL; + goto out; } key.objectid = sctx->cmp_key->objectid;