Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3867560pxv; Mon, 19 Jul 2021 10:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5HPA2DdSTgS0MU6ViZDW64jmil7mvNqCSjdV7v1u2l3CrPpOS5mJSpvaHy78IwKuVkNtY X-Received: by 2002:a17:906:cc15:: with SMTP id ml21mr29314454ejb.49.1626716353792; Mon, 19 Jul 2021 10:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716353; cv=none; d=google.com; s=arc-20160816; b=vTcpmheNeQrlGr/Z0jTwO3wlTLt1v1GdnE7xFqwBh/Ql+RHP1KdjrcFPG9ba/XVNpp FFTk+57W/Ab3Ewo8JM4sACRy6/1fEAKJfBnTT+kBMiEx/2EAB1D8Aj6lM+p65ux8ap+M 7h4R+xy/1Pk0phiOGnr2aM8SDlZoTH7bDPJhPFic91MmU8YQl5hEXgnnkOAVXAnEA8uk 6MFsJ/EVQBeFbLwz0Qu2USQ/xjhmTL+i/AvxamB0sztLo4obma/R/soFmcETjgPeG2Om 7GT1I5NH3XPSwqsAVJpPuphBWUGlxPN4UH6rBAHAcpwDoqRe6cJe0zxS6Ou6yFCbreCu meBQ== 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=BY3zEtavCZb1TN2ExJseU9KQaINpVUFk4FyfDIf0hpI=; b=lYbBP5ODPf6A8vt9Y9doTaiVRq1Dnv0H/eBZMDqe982H5brFuGKhsUg+qAYpRnqDDM EvxnpC2TExhOe1BikHbFQCXswnYK4u3qBP8GOEQ98KulQ7q5zdPTzkPwgi0tLA5XrXDp RqBsgwczxfVisz0FQe/srbB8KhTdLr8yiE2KwdeellLHFEcPcHWGRTUALOzzQPGnADVV ShqHGmy5Ze04ZCALh3RdZMiuIdlq+/fGKy1EqmkGgeYiTtqA/VBYjX+ruGxeShfyKY91 ulTv5+uemBfNut64SU1QoRsxL70QnIN+S9zbevBS9gEVqwtllh40w/E/+bw7MYindl29 mJcg== 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 a18si22171247ejv.28.2021.07.19.10.38.49; Mon, 19 Jul 2021 10:39:13 -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 S1351791AbhGSQ5S (ORCPT + 99 others); Mon, 19 Jul 2021 12:57:18 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:49706 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347144AbhGSPbO (ORCPT ); Mon, 19 Jul 2021 11:31:14 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UgI6h02_1626711109; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgI6h02_1626711109) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Jul 2021 00:11:51 +0800 Date: Tue, 20 Jul 2021 00:11:49 +0800 From: Gao Xiang To: Christoph Hellwig Cc: Matthew Wilcox , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , "Darrick J . Wong" , Andreas Gruenbacher Subject: Re: [PATCH v3] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Christoph Hellwig , Matthew Wilcox , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , "Darrick J . Wong" , Andreas Gruenbacher References: <20210719144747.189634-1-hsiangkao@linux.alibaba.com> <20210719151310.GA22355@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210719151310.GA22355@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 05:13:10PM +0200, Christoph Hellwig wrote: > On Mon, Jul 19, 2021 at 04:02:30PM +0100, Matthew Wilcox wrote: > > > + 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. > > > > If we're not going to do that first, then I recommend leaving the > > IOMAP_INLINE case where it is and changing it to ... > > > > if (iomap->type == IOMAP_INLINE) > > return iomap_read_inline_data(inode, page, iomap, pos); > > > > ... and have iomap_read_inline_data() return the number of bytes that > > it copied + zeroed (ie PAGE_SIZE - poff). > > Returning the bytes is much cleaner anyway. But we still need to deal > with the sub-page uptodate status in one form or another. There is another iomap_read_inline_data() caller as in: +static int iomap_write_begin_inline(struct inode *inode, loff_t pos, + struct page *page, struct iomap *srcmap) +{ + /* needs more work for the tailpacking case, disable for now */ + if (WARN_ON_ONCE(pos != 0)) + return -EIO; + if (PageUptodate(page)) + return 0; + iomap_read_inline_data(inode, page, srcmap, pos); + return 0; +} I'd like to avoid it as (void)iomap_read_inline_data(...). That's why it left as void return type. Anyway, let's check if it works correctly first. I think it's a high priority stuff, and EROFS uncompressed cases can be entirely cleaned up with iomap then. Thanks, Gao Xiang