Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1413569pxb; Thu, 4 Nov 2021 01:42:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw++dgyy7P1NVnN/CYRWxTLPkoUsNbY/Y8MKio/iyemrtvu1O6OvqvuyyMyrmk+a5sGCMZ3 X-Received: by 2002:a17:906:4fcd:: with SMTP id i13mr23973436ejw.472.1636015378656; Thu, 04 Nov 2021 01:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636015378; cv=none; d=google.com; s=arc-20160816; b=oHCUnpU6utz7QtZl7Xf9b+bw8Cei3EMW/7NwuuN7++a0e4k05g3JOkGR9kL5c6PYaI ETY9QxLdWMHZ7Rvn6hYOfHsMmZi8Gkzt32xitr0uRhjqV09PeBeVWnetd2iOG07RJMu2 QPyFB6nzo7gg9WuDTq6kJ8Iy+MDUQvSFpu91fxuHGInCX3g25LilTLa7dUOuYPWYTWhE aMLTXu2Hj0Pzd9+RlxVjQf9C3t0hgol0408GA/+6zy9cVHDXK8X80X6sSyU2vtuuNCUq ZTlSd1TkL7WFCZzEn2aCvNcpPFSUnpvG4JmGSBfczGEjTPJlwEidy3bBbSSKHZY2X/Cz JLyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5Z3qZq5MUEoDWPLeBRHYP9o1KIVIGNuaMXfbOKsIkY4=; b=x3Jg4JjIXztKufbPLTHMkEkzU7qNqpjr6IvSkflACYa6f3ej0GPwvhQDv/jqo3eljd b9h1GaqVrvv16U0ueh3t2dhQrcu1lC9T1hfyD6xgUOaAjZb3U13Mruq4XhES2wuSIeSH J+4M4+2TXJ/Xxa/Byoi0Zda2H7gc4jfBzirukEfchqeocQ08MiD41H6SsXHeQMY32fkw w3R1zV9i0u0vYDyLN3vxZEJUO3yP869FyG5ElEal5JqNuYqAZMd56TR5mOdSJhDOsqfF aS3WGl10Fv/pb9ShdssjG3eRgSGzVW4xPejDUO5ns0k3EbIvSNfx2J2y2LtRzXeK3mJJ WTVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=RxMrL7MH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 qf31si9008117ejc.782.2021.11.04.01.42.35; Thu, 04 Nov 2021 01:42:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@infradead.org header.s=bombadil.20210309 header.b=RxMrL7MH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbhKDIl2 (ORCPT + 99 others); Thu, 4 Nov 2021 04:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230084AbhKDIl0 (ORCPT ); Thu, 4 Nov 2021 04:41:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370DBC061714; Thu, 4 Nov 2021 01:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=5Z3qZq5MUEoDWPLeBRHYP9o1KIVIGNuaMXfbOKsIkY4=; b=RxMrL7MH99hMKk6Gs5eYutueQO Ums+y+hY8WsLMDJl6GlpfIoPPmjhcKQhcpueY1GJSkIHRnJTCcnhH2SeeQWCFCN9bkIevL/5Y+EcO F/2mRbaWyJIOuA9wAZ1i03S5HtU+LM04rezQYbx28JpzNmLAB+5xtqmfaLyh/FH+xAJPg9byf3b4F eo2RmuEPmsWZYAz4eb34OsY3y4hgdcug7cCIxa85QLg3NsawuGhgmkM6R3yR9uB2oWqe2vHI0qWo6 PfWBoRMwKG5twnQYzQqyQoRVEc3u6xAj6001td90k1L//2wJQvXPciuw31x9v6bzpZ4nt2+aLgHN/ HQnIOIDg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1miYGm-008Ktc-6U; Thu, 04 Nov 2021 08:38:48 +0000 Date: Thu, 4 Nov 2021 01:38:48 -0700 From: Christoph Hellwig To: Matthew Wilcox Cc: Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe Subject: Re: [PATCH 18/21] iomap: Convert iomap_add_to_ioend to take a folio Message-ID: References: <20211101203929.954622-1-willy@infradead.org> <20211101203929.954622-19-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 04, 2021 at 03:33:52AM +0000, Matthew Wilcox wrote: > On Wed, Nov 03, 2021 at 08:54:50AM -0700, Christoph Hellwig wrote: > > > - * Walk through the page to find areas to write back. If we run off the > > > - * end of the current map or find the current map invalid, grab a new > > > - * one. > > > + * Walk through the folio to find areas to write back. If we > > > + * run off the end of the current map or find the current map > > > + * invalid, grab a new one. > > > > No real need for reflowing the comment, it still fits just fine even > > with the folio change. > > Sure, but I don't like using column 79, unless it's better to. We're on > three lines anyway; may as well make better use of that third line. Ok, tht's a little weird but a personal preference. That being said reflowing the whole comment just for that seems odd. > > > > + isize = i_size_read(inode); > > > + end_pos = page_offset(page) + PAGE_SIZE; > > > + if (end_pos - 1 >= isize) { > > > > Wouldn't this check be more obvious as: > > > > if (end_pos > i_size) { > > I _think_ we restrict the maximum file size to 2^63 - 1 to avoid i_size > ever being negative. But that means that end_pos might be 2^63 (ie > LONG_MIN), so we need to subtract one from it to get the right answer. > Maybe worth a comment? Yes, please.