Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3900273pxv; Mon, 19 Jul 2021 11:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWmeKYr4A53ptGVX1gslWolU7bwJS+t3vdgIcGflwY8e8Y38O4mCQBwF59AmeqQF1yaYpE X-Received: by 2002:a17:906:5fc1:: with SMTP id k1mr27876760ejv.360.1626719371536; Mon, 19 Jul 2021 11:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626719371; cv=none; d=google.com; s=arc-20160816; b=jGckABpZ7cUP+yJTsFLAeNM/WbQnQfjvYlB/GU+hYDa6Q1fOQyTDTTrlTHIUWupqtm i/z60odHjyWlKKkrL2rqNYLUIOt8YwX8MknPxsUpo18XOMXGy2wPA5vDmMigawL7BRDc nFkjOAjki8MD/1kymJ5DdPJlJimDwa/lxwPxrK+Z98Rz7WZ3nOqMdgKB/J6xc64/TX2R UkRetdJATAE9kHdA4C1PC5qfRMUizP+Zbihv5KIs1mth2/WSwomIl53J6i59Hmzqn2Cr oZVtAbnFxLfET6U9k87SrCZkNfvLTTZypxUaFsu9FBTbHtqvImJBD8UbQb40CLD87DBa OU2Q== 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=t0i+7tXFhVAJI+nlAjaCd7T6XGAQwmoipG3wOX3BNN4=; b=k+jPh9Hb80n4Q4DUlJGIm11UqbJwF5+zZbGNycDYr6aBm7cAliLHqcW8K7TwCl/Px3 vlquB47x9jiVW+ZtxOAwEv7pNPt9R+21yupTI6VIfZkh0NWEXi/j930cYrJoqeOiFRum O6QCg+ErEaLg5h1ablG3WWWJeCW7EYhv8v2zPrDMp2ISgA+/gCVg5Rddb842sjmCnPzV c3t9bVroR9txr0+QuF1b0ZwPM8DR2ShOPoYZgcryVIWyoQJpC/xvCnZ5fUljMa+O8Zmt q6jhi43fddFevVZMCMdduQLMnejTGjo/PIjT5/Htz5wP+P/U+hJobEaWJCPncJeH9Dzu xMSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aukGzst6; 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 dj3si18332232edb.379.2021.07.19.11.29.08; Mon, 19 Jul 2021 11:29: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=aukGzst6; 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 S1382495AbhGSRjY (ORCPT + 99 others); Mon, 19 Jul 2021 13:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352737AbhGSQOd (ORCPT ); Mon, 19 Jul 2021 12:14:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70A3C05BD3D; Mon, 19 Jul 2021 09:09:15 -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=t0i+7tXFhVAJI+nlAjaCd7T6XGAQwmoipG3wOX3BNN4=; b=aukGzst6WKaOLTfMq0IMTJVP/W oW4ss9z0jiy2pgZaSBv/ZXarhM3VSBxdESUqy1kE7h1qXvBgiIdjbm1D5q+RQYj4PbqsL/t0+kqlh dy6KPznHqP5JpRsC8Xa6dnhQQapIQxbmuO7likzE6uh9ZP2tXjdzgXqWkCJ4c1q/Fai8CAtY7t6Ac t+jsX6iBmhYsMWUt6mBRrwDTTms5h2MroCNEe7CqBtzOy3GiC/Ba8I8TUexNnYJy7PGganCeqDRpn nmt7X3oDM8G4sFx6X+DCZ1DvbmiOAMgQs2eLqI2bNgkE2ElmUrjlqjBK82Y04+jrqh5xZE024sN6A tfAYcc4A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5WAg-0075UR-UE; Mon, 19 Jul 2021 16:31:29 +0000 Date: Mon, 19 Jul 2021 17:31:10 +0100 From: Matthew Wilcox To: Christoph Hellwig , 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: References: <20210719144747.189634-1-hsiangkao@linux.alibaba.com> <20210719151310.GA22355@lst.de> 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 Tue, Jul 20, 2021 at 12:11:49AM +0800, Gao Xiang wrote: > 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. You don't need to cast away the return value in C.