From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 253B5C4338F for ; Fri, 23 Jul 2021 15:57:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D6A260725 for ; Fri, 23 Jul 2021 15:57:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D6A260725 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GWYqC0xwWz30F1 for ; Sat, 24 Jul 2021 01:57:11 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Wxnyx+dw; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Wxnyx+dw; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GWYq81KCgz30BL for ; Sat, 24 Jul 2021 01:57:03 +1000 (AEST) 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: X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" 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.