From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC693C07E9B for ; Mon, 19 Jul 2021 11:22:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C662E610C7 for ; Mon, 19 Jul 2021 11:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236556AbhGSKlv (ORCPT ); Mon, 19 Jul 2021 06:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236825AbhGSKlL (ORCPT ); Mon, 19 Jul 2021 06:41:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15651C061574; Mon, 19 Jul 2021 03:32:33 -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=oHvZCvnyWx34050zBCmoBlfirYI9L7hPimae0Gd3np4=; b=H4yUT9cWMYv6PGWGnrxRQtjaqD tikdFFkPspmpm9WWHPs2lMO3rgdjm+yD8xfWJ4m8QSvKpK0FmtEvknaMdhjHm32O60PZ7W3ONTuLn 9JXAac35lG0QVkL8qmcTP6EvkRwAyM0IFklG6p8pq5Cyp/YVAd8uAvbm/I3YMiCnNmBJFp/lj5wjv ii3u9rPfSPFUDDkSDCqrwtPepY5ShmRTv4r5H1XKzTdQfGvbvj98RGa21oYlDCxeteU8dV7LRLk5y iKZyCZy2iKDHqLpEEKk5BJTJ+7TDna/d7Mk9NuvRNAhfekwXOl3NH24wEJWNvwTJkzBq2jzk3/cac 1XZtUd7Q==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5RJ8-006naF-3J; Mon, 19 Jul 2021 11:19:42 +0000 Date: Mon, 19 Jul 2021 12:19:34 +0100 From: Christoph Hellwig To: Matthew Wilcox Cc: Andreas Gr?nbacher , Christoph Hellwig , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang Subject: Re: [PATCH 1/2] iomap: support tail packing inline read Message-ID: References: <20210716050724.225041-2-hsiangkao@linux.alibaba.com> 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 casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 17, 2021 at 07:40:41PM +0100, Matthew Wilcox wrote: > Well, either sense of a WARN_ON is wrong. > > For a file which is PAGE_SIZE + 3 bytes in size, to_iomap_page() will > be NULL. For a file which is PAGE_SIZE/2 + 3 bytes in size, > to_iomap_page() will not be NULL. (assuming the block size is <= > PAGE_SIZE / 2). > > I think we need a prep patch that looks something like this: Something like this is where we should eventually end up, but it also affects the read from disk case so we need to be careful. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01183C07E9B for ; Mon, 19 Jul 2021 11:21:44 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36CE0610D2 for ; Mon, 19 Jul 2021 11:21:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36CE0610D2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GSzv95syHz30G8 for ; Mon, 19 Jul 2021 21:21:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=H4yUT9cW; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=casper.srs.infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=batv+9026cc9f21ac068c1222+6539+infradead.org+hch@casper.srs.infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=H4yUT9cW; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GSzv75h5Tz2yXj for ; Mon, 19 Jul 2021 21:21:39 +1000 (AEST) 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=oHvZCvnyWx34050zBCmoBlfirYI9L7hPimae0Gd3np4=; b=H4yUT9cWMYv6PGWGnrxRQtjaqD tikdFFkPspmpm9WWHPs2lMO3rgdjm+yD8xfWJ4m8QSvKpK0FmtEvknaMdhjHm32O60PZ7W3ONTuLn 9JXAac35lG0QVkL8qmcTP6EvkRwAyM0IFklG6p8pq5Cyp/YVAd8uAvbm/I3YMiCnNmBJFp/lj5wjv ii3u9rPfSPFUDDkSDCqrwtPepY5ShmRTv4r5H1XKzTdQfGvbvj98RGa21oYlDCxeteU8dV7LRLk5y iKZyCZy2iKDHqLpEEKk5BJTJ+7TDna/d7Mk9NuvRNAhfekwXOl3NH24wEJWNvwTJkzBq2jzk3/cac 1XZtUd7Q==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5RJ8-006naF-3J; Mon, 19 Jul 2021 11:19:42 +0000 Date: Mon, 19 Jul 2021 12:19:34 +0100 From: Christoph Hellwig To: Matthew Wilcox Subject: Re: [PATCH 1/2] iomap: support tail packing inline read Message-ID: References: <20210716050724.225041-2-hsiangkao@linux.alibaba.com> 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 casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Darrick J. Wong" , Andreas Gr?nbacher , LKML , Christoph Hellwig , Joseph Qi , Liu Bo , Linux FS-devel Mailing List , Liu Jiang , linux-erofs@lists.ozlabs.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Sat, Jul 17, 2021 at 07:40:41PM +0100, Matthew Wilcox wrote: > Well, either sense of a WARN_ON is wrong. > > For a file which is PAGE_SIZE + 3 bytes in size, to_iomap_page() will > be NULL. For a file which is PAGE_SIZE/2 + 3 bytes in size, > to_iomap_page() will not be NULL. (assuming the block size is <= > PAGE_SIZE / 2). > > I think we need a prep patch that looks something like this: Something like this is where we should eventually end up, but it also affects the read from disk case so we need to be careful.