Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp217437ybv; Tue, 18 Feb 2020 21:36:15 -0800 (PST) X-Google-Smtp-Source: APXvYqx+cWLLN0BhbFhdDg9ezoQiEvOB3EZi7lWeF8nFBgyDWRnmcUfUtR5Eig5ysJZZsjrLGECI X-Received: by 2002:a9d:111:: with SMTP id 17mr18249417otu.256.1582090575500; Tue, 18 Feb 2020 21:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582090575; cv=none; d=google.com; s=arc-20160816; b=c+U9L8Cl1epxzdsBgyaa40bQACmfQ9tCBaTtvty5B4zTPeLf+/AvgSI371dCv4YETi Ku46F9B8OFJ4jNru+2k6aBorKkhViOijQsRC4AXLxc6heyke4fchswAmqw6fww+B6kDG V6mb4PNRZyrjPuRm2Ek6nMMMTitKXtW//246+2aOCQHe9tHWscaqtyuj6JtCrSb+ZMGZ rK6FJMhXD9Hljslp30iUXZLOPGpP0dUkUM9CtHbChzLG2UaHqHITgj6eQk+x88zue7jf HD14Eg2vj0ewiMOQXaMRwDDrGVHc4K/bCBik2bvnbIxl/W1vRNMBwDplSoNriOsG6rik LDrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=i5jjRMxpChRQy+2J/xRxaZpOqmFrFWQR+xd6cg6u2PI=; b=HMqCTAdAWEvqMZ1NaSkqQka9hF+8Hz5hQsNZ6NLpOvA+5khAkYpuX/c3mXXh7NpIcg o+cZTUJlEMgJ4yMUNvRj1V0JB/k0MwjxpVcJ9fzZCo4b8luXjYFlucGcvd74hIaEHItX cELTnWgpfOtdMlgCRAdYjNfJ8U/ZxcN9ALywnLuKJU7TX2WheSZxCEBcpMCYCi8AreTq LGr5AB0I+KZPex7D43J8efPGF2h7VjH8koFMDZq06gy42hubDloxgwM63uo+zVIlFJOM kVKXQX3DUVKEC3Rb4QSC14XBd9UeqtD8QKWux7vV42WiGVsOlZq9PsYOBsEWKsD2u3dV 7fxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DuVHuymB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r26si615240otc.163.2020.02.18.21.36.02; Tue, 18 Feb 2020 21:36:15 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DuVHuymB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbgBSFfq (ORCPT + 99 others); Wed, 19 Feb 2020 00:35:46 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44192 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgBSFfq (ORCPT ); Wed, 19 Feb 2020 00:35:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=i5jjRMxpChRQy+2J/xRxaZpOqmFrFWQR+xd6cg6u2PI=; b=DuVHuymBPWn5wDST1aeEelhfNM /bXL88FT9MFQnHGtbK4rSNZ+luoUIXATKSnNmq0w0g+oFVWjyKpy66W6FFgRGnswoBOWQpscJbJQP 4VedcAPQbAlzmDR4kFU3J0Di3kgpR1We770va4VzU0v+3uU5Psu/vRRzwnfoiQqbwdrygPBoB0Acc Kj/viayLIFCgDZTYuGeW41k0nXnLmWVc48ZXm+FRjozkqV+sHubRee661ywX49PCOT/E1uqhfX2Ny D9csTE5YF0U7xa7/EP5Jtkli2RRKOHF+UMVo8N/d71C108g1DAP7O0iiHuaezDNJcoHL5lnGSyTJU QRfWManA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4I1Q-0004Jt-TF; Wed, 19 Feb 2020 05:35:44 +0000 Date: Tue, 18 Feb 2020 21:35:44 -0800 From: Matthew Wilcox To: John Hubbard Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-xfs@vger.kernel.org Subject: Re: [PATCH v6 17/19] iomap: Restructure iomap_readpages_actor Message-ID: <20200219053544.GN24185@bombadil.infradead.org> References: <20200217184613.19668-1-willy@infradead.org> <20200217184613.19668-31-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 07:17:18PM -0800, John Hubbard wrote: > > - for (done = 0; done < length; done += ret) { > > nit: this "for" loop was perfect just the way it was. :) I'd vote here for reverting > the change to a "while" loop. Because with this change, now the code has to > separately initialize "done", separately increment "done", and the beauty of a > for loop is that the loop init and control is all clearly in one place. For things > that follow that model (as in this case!), that's a Good Thing. > > And I don't see any technical reason (even in the following patch) that requires > this change. It's doing the increment in the wrong place. We want the increment done in the middle of the loop, before we check whether we've got to the end of the page. Not at the end of the loop. > > + BUG_ON(ctx.cur_page); > > Is a full BUG_ON() definitely called for here? Seems like a WARN might suffice... Dave made a similar comment; I'll pick this up there.