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=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable 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 BCD9AC07E9D for ; Mon, 19 Jul 2021 13:45:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96771610A5 for ; Mon, 19 Jul 2021 13:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240348AbhGSNFS (ORCPT ); Mon, 19 Jul 2021 09:05:18 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:51621 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240279AbhGSNFR (ORCPT ); Mon, 19 Jul 2021 09:05:17 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R971e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0UgH5Ozl_1626702353; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgH5Ozl_1626702353) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Jul 2021 21:45:55 +0800 Date: Mon, 19 Jul 2021 21:45:53 +0800 From: Gao Xiang To: Christoph Hellwig Cc: Matthew Wilcox , Andreas Gr?nbacher , 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: Mail-Followup-To: Christoph Hellwig , Matthew Wilcox , Andreas Gr?nbacher , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 12:19:34PM +0100, Christoph Hellwig wrote: > 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. I also think it'd be better to leave this hunk as it-is (don't touch it in this patch), I mean just iop = iomap_page_create(inode, page); as https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/iomap/buffered-io.c?id=229adf3c64dbeae4e2f45fb561907ada9fcc0d0c#n256 since iomap_read_inline_data() now calls iomap_set_range_uptodate() to set blocks uptodate rather than SetPageUptodate() directly and we also have iomap_page_release() as well. Some follow-up optimized patch can be raised up independently since it's somewhat out of current topic for now. Thanks, Gao Xiang