From patchwork Thu Jan 30 13:27:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 3556971 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 92B5C9F382 for ; Thu, 30 Jan 2014 13:27:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88F622011B for ; Thu, 30 Jan 2014 13:27:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80B792010C for ; Thu, 30 Jan 2014 13:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753087AbaA3N1y (ORCPT ); Thu, 30 Jan 2014 08:27:54 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:63508 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbaA3N1x (ORCPT ); Thu, 30 Jan 2014 08:27:53 -0500 Received: by mail-ea0-f178.google.com with SMTP id a15so1638370eae.37 for ; Thu, 30 Jan 2014 05:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PD/fk5PBBfdQtCRfqNfmvO3VioNP9ffT1tCnfhN1JVg=; b=mb0MK/g1UL9oILaCpA3Jjy/I9LCVDQlDCNJ7J/7kh5+sclu7319MWrSwcVCbLdF8B0 +u3FyDH4JF7G30E319+osdh6IdQNxrLie/45QXRCV0V4cOpsBoOWz5EMKNxGNgghngWL gy8UUn9eFse6WlZWa88BLfAbyjqM1T9/DcltYetkQcYmYYA/QB13QNbElgTRjZof173/ oGZxe2AP7IpOlz7VJ/lVXIadmvky5JwHHFD3npEadQKpBZnJNtBgIvvcZ77FMTtDbCTv 64oE9DBl3T8fROVTNpSaE1WkC5N7xMm5BvpwsIixtn4Zf7fVh7ejQIKLi6PG+drzrM6J PZ4g== X-Received: by 10.14.198.6 with SMTP id u6mr30124een.113.1391088470277; Thu, 30 Jan 2014 05:27:50 -0800 (PST) Received: from storm-desktop.lan (bl10-140-184.dsl.telepac.pt. [85.243.140.184]) by mx.google.com with ESMTPSA id v7sm22359484eel.2.2014.01.30.05.27.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 05:27:49 -0800 (PST) From: Filipe David Borba Manana To: linux-btrfs@vger.kernel.org Cc: Filipe David Borba Manana Subject: [PATCH] Btrfs: add missing error check in incremental send Date: Thu, 30 Jan 2014 13:27:12 +0000 Message-Id: <1391088432-21981-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.7.9.5 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.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Function wait_for_parent_move() returns negative value if an error happened, 0 if we don't need to wait for the parent's move, and 1 if the wait is needed. Before this change an error return value was being treated like the return value 1, which was not correct. Signed-off-by: Filipe David Borba Manana --- fs/btrfs/send.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 31b76d0..7250d86 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -3215,7 +3215,10 @@ verbose_printk("btrfs: process_recorded_refs %llu\n", sctx->cur_ino); * dirs, we always have one new and one deleted * ref. The deleted ref is ignored later. */ - if (wait_for_parent_move(sctx, cur)) { + ret = wait_for_parent_move(sctx, cur); + if (ret < 0) + goto out; + if (ret) { ret = add_pending_dir_move(sctx, cur->dir); *pending_move = 1;