Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4163261pxv; Mon, 19 Jul 2021 18:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP8Vv0myQWfuOToKHkzWzDSbwqredB6HnyNGFSP91SorzXtjijsh36PfNg81gE9ZzJS6W5 X-Received: by 2002:a92:dc4a:: with SMTP id x10mr18657032ilq.166.1626746261733; Mon, 19 Jul 2021 18:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626746261; cv=none; d=google.com; s=arc-20160816; b=hlX3XL3pLpcOW6pDMrfJzNxf6Jb8Ch+HDjto+25Yytjd5q4aMf8JEDLY48dKMgYwCw UwLWr/7yAKkhsbnEDxvjf85cTuUAJlr7tlStX+Ka2sXumtSN4P1WpBtPZTo3n1kZazIs 9CDaOsvZrH4cmK6UAqZ0Ua4fRchliyPnNDgt1rZ1tZnBmxPDSS+u8xch8zdsjcuhrr7R JJw4SxTNCo3XNqcIlrGSGi601Jn2rPnA2/0r+l1EMqBNvO10Vhynp+PMJ4w1gbCqq8Or LRVbUfPzW5q13uHxVNlv3UU+B5zu0BJIi71t3qUdi/rmzHbovnnhrKRFAdpSz8/sbFGe PstQ== 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-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=9jG+7Rzi+O6K7ekZiq892V76KoNNed3Hb+XoRQb5H7U=; b=LIFQ/1rFDaIdo9T6o4pA1YwZXXHje0w90JseQu4qiA0jEWrDk06b7F5znVJ8I8q+nd IME2l46P4VBkMp0u/H5d/smdJU9CMwHHA6sxjDTkyUnLn/+01v/VbOnASIoP0OhMepSI JRB0CUbtC5PkVDDifsRNmrOfl60WKd0A7wOaAERi21fTgX/4olxtyc2whCU1/E20BSVc Fo+/3/NqTao5b5yBzbOdheJnM8tar8wetj3wMl1S6opnD2wkPtJ2kGrNU+ZcN7Lf4CxV D+w21/e8/rVCgtft1MILIIjiY6OJsCwLanzMPhQTu9cQxBWE/AcS2TE38idNYCAPyg8c D/8A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si21680536ile.92.2021.07.19.18.57.30; Mon, 19 Jul 2021 18:57:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241433AbhGSPcx (ORCPT + 99 others); Mon, 19 Jul 2021 11:32:53 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:52019 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232795AbhGSO4H (ORCPT ); Mon, 19 Jul 2021 10:56:07 -0400 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?= Cc: Matthew Wilcox , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , Christoph Hellwig , "Darrick J . Wong" 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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