Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6087121rwl; Tue, 4 Apr 2023 07:41:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZeyvepvYl3qq8svVd9ciDjFQh3BM3MSqHXmaODX3dndjdFqwU6sRs5EU8BhtDkC7ZU57eA X-Received: by 2002:a17:90b:4b8a:b0:23d:41:3582 with SMTP id lr10-20020a17090b4b8a00b0023d00413582mr3226038pjb.8.1680619293720; Tue, 04 Apr 2023 07:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680619293; cv=none; d=google.com; s=arc-20160816; b=LtGlx5Ia1a25CO4Z6XQG7k5t422QTdL6g7MnwlsL/vvhkodDv4Fd6Ugg59xGUU4mD7 IGODXF+EHOyLylDa4zIjHVx61Z/1wpmbzFhsDJymNtnEC6cCPqmMdSXTsNQXzn9gwJCi P+E7ZQl0MNmZK1ruavzPeLVbRuLtrLiHDvyAkpJEN2bu0fLj7QEc6mnTJVBs/y8i1sHM ZpW2sLnhkdIFn1C2JVRujJzjE+jB0EaHyCDWc2AIpdUmGtXPFRL6kLowSRXuMV36Mym3 vp4ucybAXPXfIKeQaCYwLlUB/o8ZbwX0f3NAAXhDt4t1s6QgJeafzwMVacrIbwVfkHqE 0ymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=mCNX6jMy3leI09WsbKe+uKpwz7EN7It6JkT6Gx8Smp4=; b=JPx2k+ZspChQ4IxyrFqwlPX0JE66CByXThmwX2+YpGHbgyo21c8FI9U3hSwomCMYZx +h779KRWImLXUeiiTjiNRWFBhOs0xFZbKM2B3mAXD+KETp+XC0qklOkl4gOgK8x+E6LH TsSut7fjJg9dmj9ZOEDH/PgkQlDTVoxaqYHEBcMZ5wauslaHGzUCn2XnIFS2s7rImQ3z QOzchXqExqEvbg/xFyEZPmRjMlJML69TlxNPDhR0iFj/NbEFMZQ6cx5TzvSjJ+1yNKId U/93/Gc/HrwHG+iyLSfNY15YY6Cw8aEuK77Y+y+v9A/kJjHutPwKBu43T47GVlpU9RDR OSIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a17090ac28100b00238aab7e540si6618468pjt.4.2023.04.04.07.41.21; Tue, 04 Apr 2023 07:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235122AbjDDO1H (ORCPT + 99 others); Tue, 4 Apr 2023 10:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbjDDO1G (ORCPT ); Tue, 4 Apr 2023 10:27:06 -0400 X-Greylist: delayed 457 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 04 Apr 2023 07:26:46 PDT Received: from sandeen.net (sandeen.net [63.231.237.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 231BC19BF; Tue, 4 Apr 2023 07:26:45 -0700 (PDT) Received: from [10.2.0.2] (unknown [37.19.199.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id C1978325436; Tue, 4 Apr 2023 09:19:07 -0500 (CDT) Message-ID: Date: Tue, 4 Apr 2023 09:19:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: Ryosuke Yasuoka , djwong@kernel.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230404084701.2791683-1-ryasuoka@redhat.com> From: Eric Sandeen Subject: Re: [PATCH] xfs: Use for_each_perag() to iterate all available AGs In-Reply-To: <20230404084701.2791683-1-ryasuoka@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/4/23 3:47 AM, Ryosuke Yasuoka wrote: > for_each_perag_wrap() doesn't expect 0 as 2nd arg. > To iterate all the available AGs, just use for_each_perag() instead. Can you explain what goes wrong if it is zero? Is there a test for this? If it's a general problem, what if the other 2 callers pass in the variable start_agno with a value of 0? (I may well be missing something obvious as those macros are a bit dense) Thanks, -Eric > Signed-off-by: Ryosuke Yasuoka > --- > fs/xfs/xfs_filestream.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c > index 22c13933c8f8..48f43c340c58 100644 > --- a/fs/xfs/xfs_filestream.c > +++ b/fs/xfs/xfs_filestream.c > @@ -151,7 +151,7 @@ xfs_filestream_pick_ag( > * grab. > */ > if (!max_pag) { > - for_each_perag_wrap(args->mp, 0, start_agno, args->pag) > + for_each_perag(args->mp, start_agno, args->pag) > break; > atomic_inc(&args->pag->pagf_fstrms); > *longest = 0;