From patchwork Wed Apr 24 16:51:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 2485431 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 16179DF25A for ; Wed, 24 Apr 2013 16:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756983Ab3DXQvk (ORCPT ); Wed, 24 Apr 2013 12:51:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51440 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756128Ab3DXQvj (ORCPT ); Wed, 24 Apr 2013 12:51:39 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F3E9FA5077 for ; Wed, 24 Apr 2013 18:51:37 +0200 (CEST) Received: by ds.suse.cz (Postfix, from userid 10065) id 03D9FDA781; Wed, 24 Apr 2013 18:51:36 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH] btrfs: handle errors returned from get_tree_block_key Date: Wed, 24 Apr 2013 18:51:34 +0200 Message-Id: <1366822294-9193-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 1.8.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: David Sterba --- fs/btrfs/relocation.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index c22ccfe..e85be23 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2878,8 +2878,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, rb_node = rb_first(blocks); while (rb_node) { block = rb_entry(rb_node, struct tree_block, rb_node); - if (!block->key_ready) - get_tree_block_key(rc, block); + if (!block->key_ready) { + err = get_tree_block_key(rc, block); + if (err) + goto out_path; + } rb_node = rb_next(rb_node); }