Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp591157pxb; Wed, 3 Nov 2021 09:06:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhbrqfd7REHCz+cKg+3jlbrPAhW8Dqu7ORP+8hUqodG2Cb0o8XK7aV0J83YTpj5LbeFaAf X-Received: by 2002:a05:6e02:188c:: with SMTP id o12mr15958955ilu.259.1635955609399; Wed, 03 Nov 2021 09:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635955609; cv=none; d=google.com; s=arc-20160816; b=o2eNQCGU0ljr7ypFp+x5jkKN6zUy4GmfX5tkDYTHo6GDvWkfYSVRLq8f0ODW0X9thU eZ+Vehu2DN/sb/nHVez9dfwiuoqQ1SE1wX6iX6f8QPXEaX4tEQ1e7TEJ5mBTN5g+nOYt 04WJ6i3MB+1I7mmdEfm/pwbVvvtYpVegw5jDS4bF0FYlPfELvyEaoYgcQpm0vgeTMYec uwRlEgUxoHmP2TKwGiFVc1XT5CNT2e0NV0fUUuzzWUrK62ivX3PXFby28puTicH9rnQC fqrqNO2JdOF8KGOL1q9SxQ1AssNWUK1b3h8krV1ZsRprnuBvBZLbvRxTD/T6tF7Y3wj5 Y6MQ== 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=uE0rxLttjK5oQiV2LfnAfaA2vfY1/syJiodWSwCBiMI=; b=fulMfbRmXIpReEifNGVsvlzmSW8QENQAsQtUc6cYHfrK+1MSCxP70gum/IuBhrrFTy asj+5GCIZjJHhRcB9jSqZtJUx1IgdV97WLa9SmNak5MNAuSS5PWT9MFJ5nQctnN0y3Jb afnSVu4DBgRaWrVpREVcGuYOmifApQdjvqAryI+IEPjUHj3p6koua5rNqHwRe52Ii2ys XZ+FPNIk90wtdRoEiQiWAu/1s+TJAgc1/oEmmu+yozQJk013kRw7aud42b9S9dpzi+T3 1q3YPmzHCVaSRVFZQ+LSDJbAJ1JZ5MaOsPhBk7xYhzUlNt0MOWb7kERkCFcOym3JkxZQ +9fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/RyYNRz"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si279737ilu.157.2021.11.03.09.06.34; Wed, 03 Nov 2021 09:06:49 -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=@kernel.org header.s=k20201202 header.b="O/RyYNRz"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232718AbhKCQGC (ORCPT + 99 others); Wed, 3 Nov 2021 12:06:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:44558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbhKCQGA (ORCPT ); Wed, 3 Nov 2021 12:06:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C2CA60E05; Wed, 3 Nov 2021 16:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635955404; bh=VdzyOXIa72ehsiwx9jkfJlFTSTYwgaxaCrEufr0H8+Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O/RyYNRzZxjmfm928yxBHS1y19UyxKFRieUV6DaFDhlxkec7YbIl2TnLw8L/JKUJt QEhM/8XP1W0wkwkc9pgZW5vvhP0KvEtbYAigNLuOlH2yOhaF6+DpOLdMSRtFn7IRrg lK6mFqZD9nqJzZFotqKlBrLVGAp6FNhjGKs5ntzBjksF5Of7eNPGl1pQMZUyhjus6b B36nlzBYubR3s3FZQgWshheURZrYH2TMEYpyzY/Ej9J+2HPRQiBky9RVVspJZiuZXl oGLxTFy3tlnEaAIs6DCK0X/Njas7Zxm9kzLO7mmgBzR/QzmAJSwRoJAw6Fv5IbedGt XZUXINn331a7A== Date: Wed, 3 Nov 2021 09:03:23 -0700 From: "Darrick J. Wong" To: "Matthew Wilcox (Oracle)" Cc: 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 20/21] iomap: Support multi-page folios in invalidatepage Message-ID: <20211103160323.GM24307@magnolia> References: <20211101203929.954622-1-willy@infradead.org> <20211101203929.954622-21-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211101203929.954622-21-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 08:39:28PM +0000, Matthew Wilcox (Oracle) wrote: > If we're punching a hole in a multi-page folio, we need to remove the > per-folio iomap data as the folio is about to be split and each page will > need its own. If a dirty folio is only partially-uptodate, the iomap > data contains the information about which blocks cannot be written back, > so assert that a dirty folio is fully uptodate. > > Signed-off-by: Matthew Wilcox (Oracle) Looks good to me, Reviewed-by: Darrick J. Wong --D > --- > fs/iomap/buffered-io.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index 3b93fdfedb72..9d7c91f9ec1d 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -470,13 +470,18 @@ void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len) > trace_iomap_invalidatepage(folio->mapping->host, offset, len); > > /* > - * If we're invalidating the entire page, clear the dirty state from it > - * and release it to avoid unnecessary buildup of the LRU. > + * If we're invalidating the entire folio, clear the dirty state > + * from it and release it to avoid unnecessary buildup of the LRU. > */ > if (offset == 0 && len == folio_size(folio)) { > WARN_ON_ONCE(folio_test_writeback(folio)); > folio_cancel_dirty(folio); > iomap_page_release(folio); > + } else if (folio_test_multi(folio)) { > + /* Must release the iop so the page can be split */ > + WARN_ON_ONCE(!folio_test_uptodate(folio) && > + folio_test_dirty(folio)); > + iomap_page_release(folio); > } > } > EXPORT_SYMBOL_GPL(iomap_invalidate_folio); > -- > 2.33.0 >