Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3924229pxb; Tue, 2 Nov 2021 00:31:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGVVC25vsTF7VaYyip8Jyhj49BG8kZ5JWg7ow+WP0h2DIvE/JRxwLvHRBR9T+GG6jJ1Zpo X-Received: by 2002:a17:906:2f10:: with SMTP id v16mr42319723eji.434.1635838265428; Tue, 02 Nov 2021 00:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635838265; cv=none; d=google.com; s=arc-20160816; b=csCWS5wUJvC1E7HVm+lC8q1Bb09RAaEOh1pHBp4Jf4ekIzAgfnp5JTkU8ZAc8nmZ4O Xa3V3pEJZzZ0oDOrMVIyfwjXFEDUfSoBINdMxkdCVmV2sn/CkmyhdYVww1OYuL2cOl5R r718qKDErhCxRayOzC2Cm/leSavQgPGd+rrRO9lZ7c5vpp/TXq/nKnF+xbaQxuSvOSDh P2TvT2sIR2sUXF7kokKl5BIwAeDbQFg85DzXxo53kGPRSEbrngA9tVIBnbhB4FPuk7Qf k2tIpHziooHio5/YpnMUY1s6SFLpcxIamPa5auZIUQ5pJPXR1kYfgfaNUlO61HCdF0ES 1YNw== 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=PVVbJ+L6vQN1A1jcNpOyUiq5xpDOlQSOqXfQWlozuyo=; b=W51c/o1bc6zK5roICrQFIp4HpAcJfZTWM60bhg/cETm0wcvr6HbqYsXDsylw61KuOC o5q8W9kNMNAEDG4EjQeHsxwyHqO8FMubaYz2SrWfwbMZDtP5l85gOG0Av3gMlWSnzKAB lATolO0sTu8H6agP9aMC6KXS3sgWC5VyssbHYaVbu98ds2BsGQcbRo/Kk9JqG65ncCcj ndsWiRpIXjrxUyXfydbI+sL24H5pJtt0PlYgfwOr0ZhJ4V0qlGMCN/X6XLl4+bLaJRuS Kn6dQKzNNAWVdVANLuaaBEyXhz/k5KGeLuflwzyFL7s1kf9K1j1r61GGFWQoydEh3Tqc FZWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=G0cJsbWB; 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 do9si4377300ejc.704.2021.11.02.00.30.41; Tue, 02 Nov 2021 00:31:05 -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=G0cJsbWB; 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 S230255AbhKBH3T (ORCPT + 99 others); Tue, 2 Nov 2021 03:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhKBH3S (ORCPT ); Tue, 2 Nov 2021 03:29:18 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF3EC061714; Tue, 2 Nov 2021 00:26:43 -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=PVVbJ+L6vQN1A1jcNpOyUiq5xpDOlQSOqXfQWlozuyo=; b=G0cJsbWBva68Jqi2KKs+MyKrgY 3qn0pmmYTkuj39dlW/O0Ptt86hSqG7bftMNnK1dKVUaKaPMdT9nCCA95myTl82oHWKqfItT0PMg2o 5YoOWLied2s1pC/u0EEaidX52RVDxWhg3NEctu6oiwKXYEFV64V4P+VXYU3dFuFJqLoqPHdCtmWZ+ QAtpVHsq7S/Q389i20jbD2Qeq/XCtGiM3iBOSp5Mb6CBZulk4W2BtKBDrDQ3EbdSCQB284SyRemRf ijxdP5YvmKzUh62pkdVdj4fQ7IjAxOHsgM+dNQlVCZ7Cnws5APolZpyNWNRFmbZZ/dJKnXozMvCQU toxPmcyQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhoBu-000mDv-GQ; Tue, 02 Nov 2021 07:26:42 +0000 Date: Tue, 2 Nov 2021 00:26:42 -0700 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" 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 , Christoph Hellwig 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: <20211101203929.954622-19-willy@infradead.org> 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 Mon, Nov 01, 2021 at 08:39:26PM +0000, Matthew Wilcox (Oracle) wrote: > @@ -1431,11 +1428,9 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data) > * | desired writeback range | see else | > * ---------------------------------^------------------| > */ > - offset = i_size_read(inode); > - end_index = offset >> PAGE_SHIFT; > - if (page->index < end_index) > - end_offset = (loff_t)(page->index + 1) << PAGE_SHIFT; > - else { > + isize = i_size_read(inode); > + end_pos = folio_pos(folio) + folio_size(folio); > + if (end_pos - 1 >= isize) { Looking at the code not part of the context this looks fine. But I really wonder if this (and also the blocks change above) would be better off being split into separate, clearly documented patches. Otherwise looks good: Reviewed-by: Christoph Hellwig