Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2246767pxv; Sat, 17 Jul 2021 08:05:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwblKXLHb8FgaVarIqiMLOzmA4W4/7ugBe4vgmsRAwc39Ob3MhmBFOxiZDVKqNn9erzpNNs X-Received: by 2002:a17:906:70b:: with SMTP id y11mr17926386ejb.328.1626534332006; Sat, 17 Jul 2021 08:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626534331; cv=none; d=google.com; s=arc-20160816; b=lf0mE8ga6gf/5ZBxqXMzOX77Zi5PtheQQp0kOTbAUwtDxhjrAkcficGkIXfjLffFji 6GtPgT9Ip+wsCU1VEfx1lTW3Ky8lzeU5iUR0mp6EtcrdHDtVdtwW+S3Yd5PISv8wFY7n AdOO+Ii7dmz0CREDRNf+tX9T6Z0Lwu7/wl3NyXLETAo0u7hwGOwPllaPly9aDCaUSvrf ey4Tb8Qro5EIY3xCng0CRwz2gj7T9Wq4iP6ndlmaYwihtJ0r6fCFwoIZI5qx6aLH9jpb vuOaVhcZvJi6d/hVa/rbNLX7VLMb0wdu3y60RfJmIuVDQVmOIocLziJN6VF/8bA/UjXZ jMXQ== 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:message-id:subject:to:from:date:dkim-signature; bh=7Xw1VcuTjgZ49t25zIRxicvryRU564jX2lY4pUY5o3A=; b=YsOeFohtWRJTRRpnWR3GnK93Cu2qie/7E2gnl25cgg5oPINgeLS2xPQMh646s1GXcC 7CtiBcbup8I/rtRWJZ5eizlylhlgbClwNbBDwZl8CskX+1Zky2UGhEdnF1OXXb5woELH awi4cD0N2h+oFjqOeCh1wF/5hSELbuZYM7Wkr965d0iddAA280MN0HU8dt7pj4ou1v47 J7Nq4d7odyD+stUylypMBQomYyJUp/ckjWWkFcCwj6/yF+Rcs5jj7NURmcjknyEf5bYx YUmcViNK1CXe8T/7n5Pcu5RaGIZ/aiHZIlv7Q8QThjwg5idHbDwN8+Uy3PeSpOEnk4rb zHZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RyqOFqwm; 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 h13si3139100ejs.401.2021.07.17.08.05.08; Sat, 17 Jul 2021 08:05:31 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RyqOFqwm; 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 S234604AbhGQPFi (ORCPT + 99 others); Sat, 17 Jul 2021 11:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234897AbhGQPFe (ORCPT ); Sat, 17 Jul 2021 11:05:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D65C0613DD; Sat, 17 Jul 2021 08:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7Xw1VcuTjgZ49t25zIRxicvryRU564jX2lY4pUY5o3A=; b=RyqOFqwmgDZXOtufkLpg6oCwEA juLFgW5sohegVkvt2PoNEwetF9INUp/TQwEtIfRYrlmd857WmaWVYc/IvC4oU+AGgmehR1Ggw3FPX nnU6+802ktykPsc9EROMcYW2QcUASskCnC+CDixXS6EPaGr6N+81kHUzTMRoPbAXNSk2FJtQY5vdA Qz1Ld4JR5SDFJFqKSyutbJYAhNP0sfjdT3Jyo6vM0jkv+WSGOjPg/xz3hk3X80TWCVjE+13HzSmFX 35qCT05yvpyQP8eLxR9prjIxoAxDWrf7h0mgtqdWrBvhMZ+Ant9h/e4UHRg7gmD8ZgcIk4iOVmjSU e4dvHlRw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4low-005LrJ-Da; Sat, 17 Jul 2021 15:01:49 +0000 Date: Sat, 17 Jul 2021 16:01:38 +0100 From: Matthew Wilcox To: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= , 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: References: <20210716050724.225041-1-hsiangkao@linux.alibaba.com> <20210716050724.225041-2-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > 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 again for the INLINE extent and you'll hit the WARN_ON_ONCE. No?