From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CC0D3603C2 for ; Wed, 18 Mar 2026 05:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773813326; cv=none; b=lTmAqxWtPHX1m0zDYgSZyC+i2ndn1edzwYz9GHe1AO0DMVN5t/yk8KaDaNC7Zgiji9lhvC8QBJ5NCfPW6kV9lKE/Aj31tY2S49nu2nj2kaT6OIFvs1+LDTzWofG3SdJeg/h1rX9unSUVZfGVSFrTUemav/BOh+mBVlB99WQrGcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773813326; c=relaxed/simple; bh=IuMF8pwjaUIADb5Hc+KEgalcsVjHm3FkhCO2R6DLNQc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EtomJglBe1xWB3uuHkVyVRiL1y2W1LAxYI/MNgBpeUa4ZbjFXvK1Y4DDH9KgxFEJJk1C2MmQHVTYqKemBWr5ELMIU0sjkLdV2H5UNm5sqzGPbNmd0+JeEg21x6Nx+E+U315PwRQigQ5ZfzyK+TfO235V15qQ9BjELDSnum4k/l4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=rXjyzjd0; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="rXjyzjd0" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1773813316; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=Oz6FSNpJ9r2YXlOYiH9pQs1PlxKIRZcodnzRi118zlk=; b=rXjyzjd0WCzprsDddnv/w/xsvOyUPTuDjY8BFc0UANKBI+/0yhYExGOEEgNGU5f84vf6HnC0J0wquMC6jLs4bCVjHmEMzYXWSUUDrMdNgjaasp9Xa1fKCNX7R7PdUqSC9R/7n/XZNduKkGLK1iigSOjMFSQEzFkubzehAH0enqQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R681e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045133197;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0X.DGewr_1773813315; Received: from 30.221.129.103(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0X.DGewr_1773813315 cluster:ay36) by smtp.aliyun-inc.com; Wed, 18 Mar 2026 13:55:16 +0800 Message-ID: <075f5ad1-6512-49cc-8959-daf733cc3d06@linux.alibaba.com> Date: Wed, 18 Mar 2026 13:55:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] ocfs2/dlm: fix off-by-one in dlm_match_regions() region comparison To: Junrui Luo , akpm Cc: ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, Yuhao Jiang , Mark Fasheh , Joel Becker , Sunil Mushran References: From: Joseph Qi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/7/26 3:21 PM, Junrui Luo wrote: > The local-vs-remote region comparison loop uses '<=' instead of '<', > causing it to read one entry past the valid range of qr_regions. The > other loops in the same function correctly use '<'. > > Fix the loop condition to use '<' for consistency and correctness. > > Fixes: ea2034416b54 ("ocfs2/dlm: Add message DLM_QUERY_REGION") > Reported-by: Yuhao Jiang > Signed-off-by: Junrui Luo Reviewed-by: Joseph Qi > --- > fs/ocfs2/dlm/dlmdomain.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c > index 0a28cb5ded2a..dc9da9133c8e 100644 > --- a/fs/ocfs2/dlm/dlmdomain.c > +++ b/fs/ocfs2/dlm/dlmdomain.c > @@ -1002,7 +1002,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm, > for (i = 0; i < localnr; ++i) { > foundit = 0; > r = remote; > - for (j = 0; j <= qr->qr_numregions; ++j) { > + for (j = 0; j < qr->qr_numregions; ++j) { > if (!memcmp(l, r, O2HB_MAX_REGION_NAME_LEN)) { > foundit = 1; > break; >