From patchwork Mon Feb 3 18:24:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 3570431 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 229139F2E9 for ; Mon, 3 Feb 2014 18:24:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6CD01201B6 for ; Mon, 3 Feb 2014 18:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9863220160 for ; Mon, 3 Feb 2014 18:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753686AbaBCSYX (ORCPT ); Mon, 3 Feb 2014 13:24:23 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37448 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbaBCSYW (ORCPT ); Mon, 3 Feb 2014 13:24:22 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D4E87AAD1 for ; Mon, 3 Feb 2014 18:24:21 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id B77CBDA876; Mon, 3 Feb 2014 19:24:21 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 5/6] btrfs: send: remove BUG from process_all_refs Date: Mon, 3 Feb 2014 19:24:19 +0100 Message-Id: <8e818f06cc42796533133bd65194a863291ea744.1391447200.git.dsterba@suse.cz> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are only 2 static callers, the BUG would normally be never reached, but let's be nice. Signed-off-by: David Sterba --- fs/btrfs/send.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) 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;