From patchwork Thu Jan 24 11:53:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yang X-Patchwork-Id: 2031331 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 A043EDF264 for ; Thu, 24 Jan 2013 11:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753982Ab3AXLyy (ORCPT ); Thu, 24 Jan 2013 06:54:54 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:24096 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753863Ab3AXLyn (ORCPT ); Thu, 24 Jan 2013 06:54:43 -0500 X-IronPort-AV: E=Sophos;i="4.84,530,1355068800"; d="scan'208";a="6641122" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 24 Jan 2013 19:52:33 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r0OBsewm026450 for ; Thu, 24 Jan 2013 19:54:40 +0800 Received: from [10.167.225.168] ([10.167.225.168]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013012419534361-34499 ; Thu, 24 Jan 2013 19:53:43 +0800 Message-ID: <510120C4.10406@cn.fujitsu.com> Date: Thu, 24 Jan 2013 19:53:40 +0800 From: Chen Yang User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: linux-btrfs Subject: [PATCH] Btrfs-prog/send: fix wrong best-parent assignment in, find_good_parent() X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/01/24 19:53:43, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/01/24 19:53:43, Serialize complete at 2013/01/24 19:53:43 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We use find_good_parent() to look for a suit snapshot in the clone source snapshots as the parent, not the source subvolume of the snapshot which is about to be sent. fix it Signed-off-by: Cheng Yang Reviewed-by: Jan Schmidt --- cmds-send.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 9b47e70..3a88c54 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -150,7 +150,7 @@ static int find_good_parent(struct btrfs_send *s, u64 root_id, u64 *found) if (tmp < 0) tmp *= -1; if (tmp < best_diff) { - best_parent = parent; + best_parent = parent2; best_diff = tmp; } }