[5/6] btrfs: send: remove BUG from process_all_refs
diff mbox

Message ID 8e818f06cc42796533133bd65194a863291ea744.1391447200.git.dsterba@suse.cz
State Accepted
Headers show

Commit Message

David Sterba Feb. 3, 2014, 6:24 p.m. UTC
There are only 2 static callers, the BUG would normally be never
reached, but let's be nice.

Signed-off-by: David Sterba <dsterba@suse.cz>
---
 fs/btrfs/send.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch
diff mbox

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 4e3a3d413417..b0bf4ff40b5b 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -3568,7 +3568,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;