Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3790838pxv; Mon, 19 Jul 2021 08:49:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEmkFT7UQLseJhqUYjB53qITkw1kzAKkO1KZiWXvnHhz524HvOC/3+y6GqxHbOZEM1vkP3 X-Received: by 2002:a6b:7948:: with SMTP id j8mr18985544iop.32.1626709789282; Mon, 19 Jul 2021 08:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626709789; cv=none; d=google.com; s=arc-20160816; b=dzpDqCEPtkg9nnZTGmzWggpzUFHffJbqckb6eR/BzBO2Kp67QyAfLFCce9ubNOZnE2 VuAvvc0EX89A11EsV5LAG0BeVHZX/mPjTHcuvgp5MVStevn0Iw6fJ1ovSlaY3aoN7u7Q tNVXVWihgII9kG6/V/uEhCH+XTyLY5ab3+/AUGDWKhHMuiTTTS0NSHKg3WWtWNDTHjRq UmmHqchoqQkfcSes1w4jNvSI78QbtRmJRiy2+wBxvbiBGcXjzJhOGAWfo7JgXwh357Qc VptKne+iA8jk0IZal6QEdbdaWz0UwHmeR5GoBdxeBL1J0MVsRSs2Au0/FUA2Gm/xZcAm oSLQ== 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=+XdEUsabw858exKrVmEvfD8E7wBqyj8gXr9258Bv3RI=; b=wSVh6NglmY0MHOeyJ3NVJgX6/HgbiTJozxXgkoMTj7b6w4uvWOFJ/GtS4VgXR6/utP id2PfMabWNo+rsIqTXGk2TkMuXq61IY17EyQ1uEa33cqDiIxZ3QodBoA6uIbpGGOPxD/ 1SdYM0+Vzx0BRpBEpIgP6jYI4pLuXIhhv6lynTb4hwF92VJRh8Y+bxs8FCrJybHwjp75 f7Tyhvi/8MGSjF0i27cRJRFkKlM73BPAESPHa0mY5XZiXmN/YgFyfgSHsOwHQN+SomxE 4hqtuxpzVokmmT+HlvyPxdyxo9jXgqQ2Io71ryjrlU6NLPBKhlOUJj5lhEKTV8h8mfcT FIRg== 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 5si10017194iof.82.2021.07.19.08.49.37; Mon, 19 Jul 2021 08:49:49 -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 S1344442AbhGSPHZ (ORCPT + 99 others); Mon, 19 Jul 2021 11:07:25 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:42188 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344265AbhGSOso (ORCPT ); Mon, 19 Jul 2021 10:48:44 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;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_---0UgI5qI7_1626708560; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgI5qI7_1626708560) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Jul 2021 23:29:22 +0800 Date: Mon, 19 Jul 2021 23:29:20 +0800 From: Gao Xiang To: Matthew Wilcox Cc: linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , Christoph Hellwig , "Darrick J . Wong" , Andreas Gruenbacher Subject: Re: [PATCH v3] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Matthew Wilcox , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , Christoph Hellwig , "Darrick J . Wong" , Andreas Gruenbacher References: <20210719144747.189634-1-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 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. Am I missing something? Thanks, Gao Xiang > > 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).