Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3779871pxv; Mon, 19 Jul 2021 08:33:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIUVaxPomc2OvRYpABxuZFYM09mZzI/9vzjT9bllQGeHhVQ/ubesseR8FJr/kJ6tJElM2T X-Received: by 2002:a17:907:2125:: with SMTP id qo5mr27712571ejb.252.1626708823537; Mon, 19 Jul 2021 08:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626708823; cv=none; d=google.com; s=arc-20160816; b=pqXirW5aLxP/Qzona3Ue9MvwFwvrT9BoqnSRZNQot1xP38fFTRc91pG9lbDk0lAUmg B7NPIBm3qi0BOznfki6luXX42OkLw/St+8nUOyr3m1lvZHy0WbyPWuy6xL01kt00AnNf kiIqIZtNKBL6os6y8jFWtMd38lhSHcbNmv3J733uYxOUhErK0FxCjOw18foaPog3bZ1z cO7PxqsGCn7xTSof719mItKwy+rVaDYilLdFX27AyTWD0mPTby5Epdj1qt8k1OmoKdN7 5n8zJOTX4ZAo/OlqfhUbRYUVf4IXcVAxUZ02izu7ukYrwM8DvYCz3tiOCtSJ56h6bAYr A8wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GX9QDNdp65k+Oupd1p1fn7LL1WvNUqAM30EmNCbLDJc=; b=jU6ukQ9Fiza/8qm6BdBm+2M7nR6HXZqTBOhkswHDlKou2FbdBOidD9ZJnRbhyqaNWl LpzVFke9hLPKqwoDA0Ggz40b2JKMyWwHMWFq4ZZai8iyLqLxCUUEDSlO5zC2w0QrJ4s3 Vq3gzJP8HMFLOgG1ZEfOzcYu5c8iVyoQsyP4S9++IK2xTMuNtibBoYvtN0w+ZtLzmEiI ZseggyYCUMKv18+f9DEKbiSNDlMTV9Y0777OVnmufL0zljBrOkux9HLe6zb0N1iY0RA7 YKVVbUP6En+7Cg0OvKU+g/d6Ul7W07KAME70non3+QYTK1umVQkO9unUWc2AtRRF+nOx STdA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de54si21973419ejc.99.2021.07.19.08.33.20; Mon, 19 Jul 2021 08:33:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343750AbhGSOsc (ORCPT + 99 others); Mon, 19 Jul 2021 10:48:32 -0400 Received: from verein.lst.de ([213.95.11.211]:50020 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243437AbhGSOcj (ORCPT ); Mon, 19 Jul 2021 10:32:39 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 1206568BFE; Mon, 19 Jul 2021 17:13:12 +0200 (CEST) Date: Mon, 19 Jul 2021 17:13:10 +0200 From: Christoph Hellwig To: Matthew Wilcox Cc: Gao Xiang , 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: <20210719151310.GA22355@lst.de> References: <20210719144747.189634-1-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) 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: > > + 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.