Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1200519pxb; Wed, 3 Nov 2021 20:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvXAq2VcXGKpwAJEI1jFa3rTSfQfbCK7C1pLXkIrH02ZKS8BrPrHZ259xeVomhWJjLHpVX X-Received: by 2002:a5d:9356:: with SMTP id i22mr220223ioo.159.1635997016406; Wed, 03 Nov 2021 20:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635997016; cv=none; d=google.com; s=arc-20160816; b=x2uBRQib0WrJP85oBPiCAvsmiQt36vgRSv78feSTxuPmWEWDhQhXVowVK91qNXhltA sqT30ykn7RHL9rFhGKa7tBLbSLSZfheiEaBCgzQjkwhzucH0DrRa+GQxANlYdK9rwMFD 2B2M7X8yBDkkSEGhT9bv7lBniHwWBCMytMGpgm341/xiwE2oecec7xNd8g9+CkWqRyKO M/sfu42PfnsCmGYPISJq/yIfRrlllF83kWToldt1hN9JE5hPNhFscdgJwjHmKDDPcP4w 3q+okDNWj+JZ7r8PxZ1trGyJEwql3jRaz6O02GuPI8LaZtobQSA214/up7dQ0Zk0CBKj MgDA== 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=0O/VdyfANdJRg4X3F77zWL20vmq21Xlj10FoIbPmDkE=; b=PXqeo+MFJQWRspoKkKGYJMmgsdvsUkMAajTdm2w4ABqGpj/Kjm3vg1n263aRQ56pnj anxoeuSpfTZT5UxkWP+Lgwi+Fr7uC32kw0nZRtYnRvJ1zCblvNRW0JgLr5JAaA3EBbey r7ge7dngUbXZg/ccsioiDnqQuQsDCuLgrzGPtxMIPvvNM3hYykT27FUGJCoUM+cUGx5B Nqom83VxOsajVACm/4MkXDZLP1DqvwWXqrMBK6wFTdg3LPs+QHCDBkwpic5uLXER372v tI4sWtbrxdEDz9KthdEx6YnY9/P5sZ2JTjyzHbZ8pINCWzllqAlUz1xdllrL140urcea nwtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jXZGpKza; 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 x8si7335035ilv.176.2021.11.03.20.36.43; Wed, 03 Nov 2021 20:36:56 -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=casper.20170209 header.b=jXZGpKza; 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 S230155AbhKDDiL (ORCPT + 99 others); Wed, 3 Nov 2021 23:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbhKDDiK (ORCPT ); Wed, 3 Nov 2021 23:38:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB804C061714; Wed, 3 Nov 2021 20:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=0O/VdyfANdJRg4X3F77zWL20vmq21Xlj10FoIbPmDkE=; b=jXZGpKzaK03F2BR+7PinT0OlJM ZNizT4HqpvIaU/hRL/n+3hKgQMBVNEyXMcqV1WTcWASGCcrLdsqUoJIWpfdJO+9L5ujPVRT/jUg1p Gri+yTKxVjmkfg7SOmKbdctrPULlzYmpxE3gBJ5x8LoN2NQn+j1a4y6spJX7ZNurwOsczJ6hWclXj xReNyIJkXWCRsqxcdE8bEpOeAVaWoHqaEJ4xMn4IZLpt6IcgbPseaC//ZTTvFY7We1p50jWd8hO40 24KTepIf6d0j2PheqbZBHyrcg4Z/KGlRcMQfCGzQqe4XHPB85NYE+SOdcqaYPb6XRI2Z4pzZmeGKR N4q4L1PQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1miTVg-005dkV-Bf; Thu, 04 Nov 2021 03:34:07 +0000 Date: Thu, 4 Nov 2021 03:33:52 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: "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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > + 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?