Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp441054pxb; Thu, 30 Sep 2021 09:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXrisDJG7D26BIh+UJ9+ZAmsKIENGZCEUxfbGK6HU0jgz75eFwq3FAB3SQYFWSnvtQCCxW X-Received: by 2002:a17:906:c05a:: with SMTP id bm26mr62568ejb.498.1633018409040; Thu, 30 Sep 2021 09:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633018409; cv=none; d=google.com; s=arc-20160816; b=kNiCi+j2II1XAZJzvyPhHMyCnOV3wH98IcK3ZjcL7k8A21ipyWJRfQigB1A0XrziPF jqhJ2iB9g3E1KQjggggrrdWXmxmvBQ3X3joDY++HnOaQiFU/Y9o7vJekITd5h4OV8rnu GFLxsLmOUq/QBc3eBAZqqpfirwN476B+veQhj5Nkvy3OQsESDyBHKBupxWaJHgyUCnkv TCFSoPLQWOoGgvvsvLJWTQdjHmctszNlAit6Kuvc9e4X84tSav/4FSw45xhvOBsWFDC1 WXURIXK+zuo8033VW1RJjpzs/7cc8SyP2t6I1yOSxvVcMNNxcLA2FaXBiTR64sMid1dg ZUaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=XpddWotJDEB20/Y8A/qQAdI2vVsD5aWSl/LVh8iF40Q=; b=XUIlOusa43BVCUpZRsfQWglzppAuh6U+y1LEEJ1BP61ZPoDbN67dFecpprYh+Q6Jo5 s+Ora7qgXAiNLuJkqDvIBSI1is4CJGKXj4EkP92bC3Xzc8iyOy2ycLBOZQeaVx17xcxz xVgzY1RQN3zwJCsBn+oCFRPcJV1UghgDMfaqKqi7t/E9jMy6vTv8UsrgoENNLQ3b9iRo qcyDTdp0tiFRjlVG/iRnxpHAEiDU5fe5l8bHG4brzyoz7d/69dR+hug80q2OehGE1J50 iY5UbYAB89AUv9sCObQ+pFsPtMMKe0OIOiDqczcik/a9xi01Wtmw7bK5cHU0IjIeUHuD AVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=AQpU9JqL; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si3690808eds.195.2021.09.30.09.12.59; Thu, 30 Sep 2021 09:13:29 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=AQpU9JqL; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348103AbhI3QMS (ORCPT + 99 others); Thu, 30 Sep 2021 12:12:18 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:43172 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348067AbhI3QMR (ORCPT ); Thu, 30 Sep 2021 12:12:17 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 62842225DD; Thu, 30 Sep 2021 16:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1633018234; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XpddWotJDEB20/Y8A/qQAdI2vVsD5aWSl/LVh8iF40Q=; b=AQpU9JqLN/6kfwXY/TPDPw/NKaapn93qDicLYPiHxZyG74b/weHuUemBVpuOJblhXYXjCb YIi0hPhJX8+hKB7on/HpM6rL3GN0Igfk4kPFQbQEZpjzJYjur/ws36wGt0/zdda2bf/nKV 661upQ5LxQe9nx2W4/i9RxepvsCPXPQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1633018234; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XpddWotJDEB20/Y8A/qQAdI2vVsD5aWSl/LVh8iF40Q=; b=lE5GxDlFwdD/mmUGdzFoqUOZLj02OkCHLkdAY0FwZVi04dfngCUg0dKxbL5WzY0YMPT4D9 52AhZz4dAvKHiEDA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id 4D1AFA3B81; Thu, 30 Sep 2021 16:10:34 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id DC0781F2BA4; Thu, 30 Sep 2021 18:10:30 +0200 (CEST) Date: Thu, 30 Sep 2021 18:10:30 +0200 From: Jan Kara To: yangerkun Cc: tytso@mit.edu, jack@suse.cz, linux-ext4@vger.kernel.org, yukuai3@huawei.com Subject: Re: [PATCH 1/3] ext4: correct the left/middle/right debug message for binsearch Message-ID: <20210930161030.GA17404@quack2.suse.cz> References: <20210903062748.4118886-1-yangerkun@huawei.com> <20210903062748.4118886-2-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210903062748.4118886-2-yangerkun@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri 03-09-21 14:27:46, yangerkun wrote: > 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 Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR