Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6172144ybx; Mon, 11 Nov 2019 05:06:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwPbfUfyvgwVJKiWA//9SuwBVQi4LVSKQFwa8Nbqk7mb2ukNyaW3Xyver2lvbtnPQ/XQHjD X-Received: by 2002:a17:906:1982:: with SMTP id g2mr22778771ejd.254.1573477581177; Mon, 11 Nov 2019 05:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573477581; cv=none; d=google.com; s=arc-20160816; b=DBjUBNUMS3d1680lgIjxSPBPB0tlf/OK2Ak5Rhe162xvgcj4UOskhiZ3BU9AcZBnD8 1ZBcqc2IjWs6415e0FeUegFnA7dvanQyEqfwmFpxi/goxl0uPsD3Iy/Wye2Q0JjpihRj YEdZq2xbziKXD8IdMpZQ5bkO2x34lsPBQzeugq2RoF10KNxOdoXwhZTZJuSEp5mWz/+Q Oz8pH5sGivmtdsl6l+VrTu1BFGk+P9KXtr8tbBE/iDfiy39s5CwLp4tBhDTAyZIzib0+ aWz9iOtw3fkamsnaDcm1kk5j9mSiX8YfAfDNYV3ZoKCnb5GKGGeCXKswwzL7tnIpls0P JAxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ptfgZiJrJRT37KV6qx/ANFTtjHXD6glvvm6dcn8VVZI=; b=CeBUK+4A2ukSgBPHlRsesqM6VYSIdhfa+oCjTUPHaLzm6QS+IpNMvLhU4fS4wwSeTY UWDC77G/or7AvTg+98dwqT4ZevPH/KdBDotk8zPGgYKyMzIEzTGe7VjmEHH5Z1f9ouf9 r4Oq0OmOWLy0uqaIjQ6lqXgR0zDFhDlVpBy3QlT/C2pjNy1ZXDjNOq3C9eY3h0Gwiult nCgMnzKX/90IgJuEjF+1pW6O0zx8e0bMGXZDeVcbZxpL5dsqf3+7UP3ZPBsiUfNaG+qh BJvOU6p54hkWQ995/RRJFXFr/lrsv8S/wawAzwpr5Vx8w8H+TQtAt3n+5tuq0KwIe1ZS 2rMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=BDGOjdrO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y24si6098529ejc.170.2019.11.11.05.05.56; Mon, 11 Nov 2019 05:06:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=BDGOjdrO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbfKKNFV (ORCPT + 99 others); Mon, 11 Nov 2019 08:05:21 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:38611 "EHLO mail-wm1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbfKKNFU (ORCPT ); Mon, 11 Nov 2019 08:05:20 -0500 Received: by mail-wm1-f42.google.com with SMTP id z19so13127308wmk.3 for ; Mon, 11 Nov 2019 05:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ptfgZiJrJRT37KV6qx/ANFTtjHXD6glvvm6dcn8VVZI=; b=BDGOjdrOiR/70UcRqMcVVH7VffzPCSZLLyoX5htmD99qQ65QbHEdi1A94TTEZKTGia bu4YKgChFJqm9P5eaC7FDAyXwIxRw7WczK/jDbRGD+k2jvtrx4tcCibk7Aa52STDdVIb iPIO1FJHqec/eDyz5qyxHqj3PBz5G2DEVuBfw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ptfgZiJrJRT37KV6qx/ANFTtjHXD6glvvm6dcn8VVZI=; b=Qqq9fbCjCTR1n7QHeZwF76M0qqzFdGF8B3YMnr2q9qv2gblhsq/DeQSq9fspM0j1Qb MNQUtaet06/AZayQDkIW18hDhZ0wpw/tb6snA+muKla9UW8iaumKHPkIRhTELxYZv7rB 3qGs7Yua3gfhhCPylHh0Zqz0PkoLUvr5SQ7xp6PB9P+NUU+yZwcscgWIFpV9kVLUJO4v OQihxDWw1z6K5Gzr8yRFxLbAk7BnRijoBYcys16Zbb3n6LxrxkW3yqmUMxN85nCGqnuv o1LN46nE1pMk1K6kApX543H7bg/X2O9aPJZlmUXGNcvkJhy8NptJ2xwlnvZ3hzynTj6n nQag== X-Gm-Message-State: APjAAAUlQSpNFeKQxuvZcZ29ewgdJx69ihJnlFJyabptN5c2GIKE9ABP OhY3cPqXUYviBhF1XNktBDTr+w== X-Received: by 2002:a1c:544e:: with SMTP id p14mr19557371wmi.17.1573477518329; Mon, 11 Nov 2019 05:05:18 -0800 (PST) Received: from localhost ([2a01:4b00:8432:8a00:fa59:71ff:fe7e:8d21]) by smtp.gmail.com with ESMTPSA id u26sm14397929wmj.9.2019.11.11.05.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:05:17 -0800 (PST) Date: Mon, 11 Nov 2019 13:05:16 +0000 From: Chris Down To: Qian Cai Cc: akpm@linux-foundation.org, mhocko@suse.com, hannes@cmpxchg.org, guro@fb.com, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm/vmscan: fix an undefined behavior for zone id Message-ID: <20191111130516.GA891635@chrisdown.name> References: <20191108204407.1435-1-cai@lca.pw> <64E60F6F-7582-427B-8DD5-EF97B1656F5A@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <64E60F6F-7582-427B-8DD5-EF97B1656F5A@lca.pw> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Qian Cai writes: >> On Nov 8, 2019, at 3:44 PM, Qian Cai wrote: >> >> - for (zid = 0; zid <= zone_idx; zid++) { >> + for (zid = 0; zid < zone_idx; zid++) { >> struct zone *zone = > >Oops, I think here needs to be, > >for (zid = 0; zid <= zone_idx && zid < MAX_NR_ZONES; zid++) { > >to deal with this MAX_NR_ZONES special case. Ah, I just saw this in my local checkout and thought it was from my changes, until I saw it's also on clean mmots checkout. Thanks for the fixup! Acked-by: Chris Down