浏览代码

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 <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
David Sterba 11 年之前
父节点
当前提交
4d1a63b21b
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      fs/btrfs/send.c

+ 4 - 1
fs/btrfs/send.c

@@ -3606,7 +3606,10 @@ static int process_all_refs(struct send_ctx *sctx,
 		root = sctx->parent_root;
 		root = sctx->parent_root;
 		cb = __record_deleted_ref;
 		cb = __record_deleted_ref;
 	} else {
 	} 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;
 	key.objectid = sctx->cmp_key->objectid;