Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2254841pxv; Sat, 17 Jul 2021 08:17:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9iW5S6T8el0Jfqqmk5/MtEB2QJhSYY4fx71Hxl2dlJHB0eYNjvVYR3m4+88euPy5nrAnr X-Received: by 2002:a17:906:71b:: with SMTP id y27mr18545630ejb.80.1626535052438; Sat, 17 Jul 2021 08:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626535052; cv=none; d=google.com; s=arc-20160816; b=nQRuUaHs6D2s7nu1z+dXHaAnxcu6elufyU1lSiH3vy212gO0aaF3HNEAovIhzLVpPo DlVbp6wvcRQruE2T0k3vbuXowgbMAxcsnQ2vz850TG1BE2xC2rEyEsx0NiHERI09qT5I x4x+Jmr0NLJN1Hsxz3lvFHgQf9xAqs+uVluDQ3Bo74x/MZAmUWr9I0hf8fvqgVfFMQlq XxftFt7c6yqZmdoehiAgj38EMnpyROwcbmdc1gFwXNXQ+1xe8T+Y1QCpdGwrDYmFtKev iENdkU8Aww34RcwKRHfoCkEwxjbGxLBuzaT0UykU3yLtU3YUFBdweiVv0/JwlTkprdxM jfpA== 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:mail-followup-to:message-id:subject:cc:to:from:date; bh=pmRGycuhKNrPZ/xf8W476zSRwAVQ7JiHGtQOs877YqI=; b=krun8FSjP0oLKl+Ra+D+q2N9eAdZd0qJBdWZhkF9niSLxhFIEh4VXHsJiZXgYgAor1 4YAM6UQxwkH/7k5Dk3AyJSd90TUdXxkI8KQMTDRLSxLXAqiL5lGZvJsHJG+X8SBTRpr2 OzNELCSKsv/oW4xAlP7TxJ71PUeu43X7hxiVXXsiMS+Dp9Ve3VdwHljBlSx5nvL+0Oxf NAPXUSk8w1xJUfZId598w6Ak4THDUX7QzduqGU92859uRO/k8GclcJg7jxgkijQNN7N1 pOE3axYJrwWVa1pTpl07BRmXwMuv9B6ksE7b3LW8+g5ylhY+cygYtg3/FczH+8/CxGBl UQfA== 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 fs8si13953228ejc.223.2021.07.17.08.17.09; Sat, 17 Jul 2021 08:17:32 -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 S234582AbhGQPTJ (ORCPT + 99 others); Sat, 17 Jul 2021 11:19:09 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:20887 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234500AbhGQPTI (ORCPT ); Sat, 17 Jul 2021 11:19:08 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0Ug3MJx6_1626534958; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Ug3MJx6_1626534958) by smtp.aliyun-inc.com(127.0.0.1); Sat, 17 Jul 2021 23:16:00 +0800 Date: Sat, 17 Jul 2021 23:15:58 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Andreas =?utf-8?Q?Gr=C3=BCnbacher?= , 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: Mail-Followup-To: Matthew Wilcox , Andreas =?utf-8?Q?Gr=C3=BCnbacher?= , Christoph Hellwig , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang References: <20210716050724.225041-1-hsiangkao@linux.alibaba.com> <20210716050724.225041-2-hsiangkao@linux.alibaba.com> 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 Hi Matthew, On Sat, Jul 17, 2021 at 04:01:38PM +0100, Matthew Wilcox wrote: > On Sat, Jul 17, 2021 at 09:38:18PM +0800, Gao Xiang wrote: > > Sorry about some late. I've revised a version based on Christoph's > > version and Matthew's thought above. I've preliminary checked with > > EROFS, if it does make sense, please kindly help check on the gfs2 > > side as well.. > > I don't understand how this bit works: This part inherited from the Christoph version without change. The following thoughts are just my own understanding... > > > struct page *page = ctx->cur_page; > > - struct iomap_page *iop; > > + struct iomap_page *iop = NULL; > > bool same_page = false, is_contig = false; > > loff_t orig_pos = pos; > > 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; > > - } > > + if (iomap->type == IOMAP_INLINE && !pos) > > + WARN_ON_ONCE(to_iomap_page(page) != NULL); > > + else > > + iop = iomap_page_create(inode, page); > > Imagine you have a file with bytes 0-2047 in an extent which is !INLINE > and bytes 2048-2051 in the INLINE extent. When you read the page, first > you create an iop for the !INLINE extent. Then this function is called Yes, it first created an iop for the !INLINE extent. > again for the INLINE extent and you'll hit the WARN_ON_ONCE. No? If it is called again with another INLINE extent, pos will be non-0? so (!pos) == false. Am I missing something? Thanks, Gao Xiang >