Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1466342pxv; Fri, 23 Jul 2021 08:58:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0iZKeJ7VLyEwoQWIqkZQQNgKqAIL8Q5rU19o9GFnCSXhorDV0DW7qSqXYFRHd5AJYWak1 X-Received: by 2002:a5e:8816:: with SMTP id l22mr4569177ioj.100.1627055911469; Fri, 23 Jul 2021 08:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627055911; cv=none; d=google.com; s=arc-20160816; b=SDDKxmWDZbpb/vWybJMATnbnownQZ9lh9NSsGwpFDd1s7onnBBi8Yo7KD+oLrAIq4m xFguY/fBHYaVlEGsUYSTDFni8a34KKHb0BuelAaStjj/NXz5UTzHV7eLx7njHu8yzQHd bTAvfSp4qSk54RLV0+BfznLOU8TeRTwINEILnFCJCyGGlmAgaqiTlDQI6SOuK7+VfD/f XVrzKfu5Tay5I7Zn7jZG6NcKGL7GTIOHRalCXzm3mDCqKa7PTx6qeGiK+yvdjjFeRANM ch6To0WaWy/vdbrNwZGnUr2NyWqOTB1VkuPTV94elJmr2yUJPOUrUtXw9HDkbTzENbGA 8htQ== 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=ovsyxI38eNvliEW3ps0I8aR1LXX7PaOVRwl/PkPRFDM=; b=p6eca7LenY+6UNPKrg4ORqy9Bk5H1ANnFhNMuL2WTqw0KwXWJw38Acb2OuuoqxoP/J Cfxz30uFAcilF3EeOVNi13ubqzVdVSmhMK55ouAk/OozePYVDW+kNAORn0lbhxJ0NZ0o ZqO521pM22jsnFGcx/Gl8guscQ7/KtAKLYuc8DC5XEzjJOLTO3W0cTbdKVYAatFFGiUe wy7ESJ8bQFePdf/GxSEk4dW9JVLViGCaIvBnHwttEr3+pUDNnkFjKovMKojL5bY5JJo0 F/8M0isycTzfgs31A1UozmYU1wWgS3Q6lmv2yyim0Urxhjw4oxNy8pQnZW95Mp1AtxA3 7+RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Wxnyx+dw; 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 y14si33147661iot.9.2021.07.23.08.58.18; Fri, 23 Jul 2021 08:58: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=Wxnyx+dw; 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 S235741AbhGWPQf (ORCPT + 99 others); Fri, 23 Jul 2021 11:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235734AbhGWPQe (ORCPT ); Fri, 23 Jul 2021 11:16:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004CFC061757; Fri, 23 Jul 2021 08:57:07 -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=ovsyxI38eNvliEW3ps0I8aR1LXX7PaOVRwl/PkPRFDM=; b=Wxnyx+dw5dcaJEYk7A89PoveYG dA8Nw8DvgO2pjZqcy/y8tpZrV64svCyzBmRc/Gy4epobh41YlOfrukZvPFMZKaDuDgRSixj+x74+8 00UAFBs1Z0nkdxFm5I1rUKVQOJnBb1GiIOIfe3rk7YOPWjLbhOLitR++IQOvGval1ceVQ8xMAOmD1 vxEh5cCcxzU+c54cdxTVTtzz4Fz7zl1OwsM6MalIKvBJLh5nwtMzF3gueE10t+emldzVdMmHfpw6B QLyWdJV9mA0XiEtVWlpW3Y/3s1Z2rbjwDR1ZybmhJIHGnQ5ECIM/neeB7i0/iUlddaXiE1S+SHxbE rtiZ4Uyg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6xXP-00BVcv-W7; Fri, 23 Jul 2021 15:56:43 +0000 Date: Fri, 23 Jul 2021 16:56:35 +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 v6] iomap: support tail packing inline read Message-ID: References: <20210722031729.51628-1-hsiangkao@linux.alibaba.com> <20210722053947.GA28594@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 Fri, Jul 23, 2021 at 11:23:38PM +0800, Gao Xiang wrote: > Hi Matthew, > > On Fri, Jul 23, 2021 at 04:05:29PM +0100, Matthew Wilcox wrote: > > On Thu, Jul 22, 2021 at 07:39:47AM +0200, Christoph Hellwig wrote: > > > @@ -675,7 +676,7 @@ static size_t iomap_write_end_inline(struct inode *inode, struct page *page, > > > > > > flush_dcache_page(page); > > > addr = kmap_atomic(page); > > > - memcpy(iomap->inline_data + pos, addr + pos, copied); > > > + memcpy(iomap_inline_buf(iomap, pos), addr + pos, copied); > > > > This is wrong; pos can be > PAGE_SIZE, so this needs to be > > addr + offset_in_page(pos). > > Yeah, thanks for pointing out. It seems so, since EROFS cannot test > such write path, previously it was disabled explicitly. I could > update it in the next version as above. We're also missing a call to __set_page_dirty_nobuffers(). This matters to nobody right now -- erofs is read-only and gfs2 only supports inline data in the inode. I presume what is happening for gfs2 is that at inode writeback time, it copies the ~60 bytes from the page cache into the inode and then schedules the inode for writeback. But logically, we should mark the page as dirty. It'll be marked as dirty by ->mkwrite, should the page be mmaped, so gfs2 must already cope with a dirty page for inline data.