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,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham 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 10B8BC07E9D for ; Mon, 19 Jul 2021 15:37:07 +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 A2B696140E for ; Mon, 19 Jul 2021 15:37:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2B696140E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com 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 4GT5Ys2FJhz30Hp for ; Tue, 20 Jul 2021 01:37:05 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.44; helo=out30-44.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=) Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) (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 4GT5Yn1wh0z306h for ; Tue, 20 Jul 2021 01:37:00 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R201e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=hsiangkao@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---0UgItzbm_1626709003; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgItzbm_1626709003) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Jul 2021 23:36:45 +0800 Date: Mon, 19 Jul 2021 23:36:43 +0800 From: Gao Xiang To: Andreas =?utf-8?Q?Gr=C3=BCnbacher?= Subject: Re: [PATCH v3] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Andreas =?utf-8?Q?Gr=C3=BCnbacher?= , Matthew Wilcox , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , Christoph Hellwig , "Darrick J . Wong" References: <20210719144747.189634-1-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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" , LKML , Matthew Wilcox , Linux FS-devel Mailing List , linux-erofs@lists.ozlabs.org, Christoph Hellwig Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Mon, Jul 19, 2021 at 05:31:51PM +0200, Andreas Grünbacher wrote: > Am Mo., 19. Juli 2021 um 17:29 Uhr schrieb Gao Xiang > : > > On Mon, Jul 19, 2021 at 04:02:30PM +0100, Matthew Wilcox wrote: > > > On Mon, Jul 19, 2021 at 10:47:47PM +0800, Gao Xiang wrote: > > > > @@ -246,18 +245,19 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, > > > > unsigned poff, plen; > > > > sector_t sector; > > > > > > > > - if (iomap->type == IOMAP_INLINE) { > > > > - WARN_ON_ONCE(pos); > > > > - iomap_read_inline_data(inode, page, iomap); > > > > - return PAGE_SIZE; > > > > - } > > > > - > > > > - /* zero post-eof blocks as the page may be mapped */ > > > > iop = iomap_page_create(inode, page); > > > > + /* needs to skip some leading uptodated blocks */ > > > > iomap_adjust_read_range(inode, iop, &pos, length, &poff, &plen); > > > > if (plen == 0) > > > > goto done; > > > > > > > > + if (iomap->type == IOMAP_INLINE) { > > > > + iomap_read_inline_data(inode, page, iomap, pos); > > > > + plen = PAGE_SIZE - poff; > > > > + goto done; > > > > + } > > > > > > This is going to break Andreas' case that he just patched to work. > > > GFS2 needs for there to _not_ be an iop for inline data. That's > > > why I said we need to sort out when to create an iop before moving > > > the IOMAP_INLINE case below the creation of the iop. > > > > I have no idea how it breaks Andreas' case from the previous commit > > message: " > > iomap: Don't create iomap_page objects for inline files > > In iomap_readpage_actor, don't create iop objects for inline inodes. > > Otherwise, iomap_read_inline_data will set PageUptodate without setting > > iop->uptodate, and iomap_page_release will eventually complain. > > > > To prevent this kind of bug from occurring in the future, make sure the > > page doesn't have private data attached in iomap_read_inline_data. > > " > > > > After this patch, iomap_read_inline_data() will set iop->uptodate with > > iomap_set_range_uptodate() rather than set PageUptodate() directly, > > so iomap_page_release won't complain. > > Yes, that actually looks fine. Yeah, although I admit it looks (maybe) somewhat sub-optimal, but I think let's make it work correctly first. Then consider how to optimize it even further (like drop iops or likewise...). Just my humble suggestion of this from heart.... Thanks, Gao Xiang > > Thanks, > Andreas