Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp192295pxb; Thu, 2 Sep 2021 23:19:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk2pKKctS+gzR8jUNUvD2AvAWkXy5hDiGPhYnMTBt2pK9d8jFqAbLtczBz01vRtt4//XPk X-Received: by 2002:a5e:8711:: with SMTP id y17mr1913654ioj.16.1630649988804; Thu, 02 Sep 2021 23:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630649988; cv=none; d=google.com; s=arc-20160816; b=nxafXmzMPx4wbNZMjvKV4Qvt86YFfwAjbknTBBmJPIKQt5Qf0JSI8nDfV8Tb9No4Ik Fu1l1EMCCI8u/+FRDacMGzZt7rBa6yVbnOovaR0Rz/ESPG7RJbttkPJ+h7wEU6HhWOT2 gE/FkIUq2tEeyCTHbp7WUwXugq9OsEU1DqUmolFhgBWfX7wy7g1FGhySExJxIctq8KGi yk3kwnr4ximvKgGxjPS4xI3OOApBUKNMcQ17J+cqgyUBw0jlqGbQ2oh78/mUdgcbbEVk drSTbjxCiq5mO0Nukuy9bV3gaTfim6PqF6fBwkM/TnsofqYgzFYGOHXXvlXnAN7KECjy qPPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GbjgPCOCeUJOTeL6yCCfHt8IYrs+/jHN0Rt3lboNZBI=; b=UT3zFmmG8M6vZVH2qmesRYqCFzyUkxsRLY2nXBJvmqdeDmJy46wK7/P/HpxtCNCP1U ANbr1RlZju5aKOzYgUmG2A1sCg9d0JJvmtiIlsi9ehCsCWLftrFt3zX4FmF3RNL3bsq9 adRjkaFYP+qQFuGprNxXz83PnfLbHIVyRpujTMO24ZsEsBHQxGycbPVUvGQk6kMNPbko X9gfJRlobagpFner3YOI9WlzEW4D+mCgBoAwyAut+zaYIvEe/NDiaCo5Wnk5XvvXrly5 rluACibkiXH6KKIh3lM3pACsuLcHiQMfcH7+854RF687KPhpd4f6n2nxOHUV13UQ8exi 8/ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h30si4792548ila.1.2021.09.02.23.19.36; Thu, 02 Sep 2021 23:19:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346599AbhICGSp (ORCPT + 99 others); Fri, 3 Sep 2021 02:18:45 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9002 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345522AbhICGSo (ORCPT ); Fri, 3 Sep 2021 02:18:44 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4H16yK4tkhzYqNd; Fri, 3 Sep 2021 14:16:57 +0800 (CST) Received: from dggema766-chm.china.huawei.com (10.1.198.208) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 3 Sep 2021 14:17:42 +0800 Received: from localhost.localdomain (10.175.127.227) by dggema766-chm.china.huawei.com (10.1.198.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Fri, 3 Sep 2021 14:17:41 +0800 From: yangerkun To: , CC: , , Subject: [PATCH 1/3] ext4: correct the left/middle/right debug message for binsearch Date: Fri, 3 Sep 2021 14:27:46 +0800 Message-ID: <20210903062748.4118886-2-yangerkun@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210903062748.4118886-1-yangerkun@huawei.com> References: <20210903062748.4118886-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggema766-chm.china.huawei.com (10.1.198.208) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The debuginfo for binsearch want to show the left/middle/right extent while the process search for the goal block. However we show this info after we change right or left. Signed-off-by: yangerkun --- fs/ext4/extents.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index c33e0a2cb6c3..7ae32078b48f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -713,13 +713,14 @@ ext4_ext_binsearch_idx(struct inode *inode, r = EXT_LAST_INDEX(eh); while (l <= r) { m = l + (r - l) / 2; + ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, + le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block), + r, le32_to_cpu(r->ei_block)); + if (block < le32_to_cpu(m->ei_block)) r = m - 1; else l = m + 1; - ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, - le32_to_cpu(l->ei_block), m, le32_to_cpu(m->ei_block), - r, le32_to_cpu(r->ei_block)); } path->p_idx = l - 1; @@ -781,13 +782,14 @@ ext4_ext_binsearch(struct inode *inode, while (l <= r) { m = l + (r - l) / 2; + ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, + le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block), + r, le32_to_cpu(r->ee_block)); + if (block < le32_to_cpu(m->ee_block)) r = m - 1; else l = m + 1; - ext_debug(inode, "%p(%u):%p(%u):%p(%u) ", l, - le32_to_cpu(l->ee_block), m, le32_to_cpu(m->ee_block), - r, le32_to_cpu(r->ee_block)); } path->p_ext = l - 1; -- 2.31.1