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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 219BEC433E0 for ; Fri, 15 May 2020 13:41:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D39BC20657 for ; Fri, 15 May 2020 13:41:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FLROOFg5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D39BC20657 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 887F590000C; Fri, 15 May 2020 09:41:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 839C58E0005; Fri, 15 May 2020 09:41:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74E0190000C; Fri, 15 May 2020 09:41:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id 5795D8E0005 for ; Fri, 15 May 2020 09:41:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1DC54181AEF00 for ; Fri, 15 May 2020 13:41:40 +0000 (UTC) X-FDA: 76819065960.19.scent75_e89871623c4d X-HE-Tag: scent75_e89871623c4d X-Filterd-Recvd-Size: 2688 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 May 2020 13:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=FXuYLfOOUqxYWErosUnOKtFWf/8GnaS/MYoQGYunbOM=; b=FLROOFg5qEg5Rihr1eJZZn6DZS I72CJ7wR+QVI6Pe8yv26zoadigrAUi5HDw7QwVntYKg/gkKWgw9AkSpDCgoL9wKOLEKUIXeJ3kVut MKxeBNt01O/Ursgz7KLTIfkNNMi0SsBKAKYgb09hlpNUnsdhROZjd+Di3doKBGOZnhchUKpE0AdAg IEi4olTZl5LC9nRojXJeuxbs4gUw2qWScd9npF7Y7wGCzshZMnBFENeh5S0kfQ6Dox05nhL3+R6/y Ndg31NnKTGSkofRnNmyBp7aQThjcpkCVuihZZnpS1cs47OTIf/fbw3xUxKcxmodP+M1UUk0sq+QpH rL3mFmCg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZaCz-0005ew-KV; Fri, 15 May 2020 13:17:01 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH v4 17/36] iomap: Inline data shouldn't see large pages Date: Fri, 15 May 2020 06:16:37 -0700 Message-Id: <20200515131656.12890-18-willy@infradead.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200515131656.12890-1-willy@infradead.org> References: <20200515131656.12890-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Matthew Wilcox (Oracle)" Assert that we're not seeing large pages in functions that read/write inline data, rather than zeroing out the tail. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index b7504b8aa90c..782757258a28 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -221,6 +221,7 @@ iomap_read_inline_data(struct inode *inode, struct pa= ge *page, return; =20 BUG_ON(page->index); + BUG_ON(PageCompound(page)); BUG_ON(size > PAGE_SIZE - offset_in_page(iomap->inline_data)); =20 addr =3D kmap_atomic(page); @@ -732,6 +733,7 @@ iomap_write_end_inline(struct inode *inode, struct pa= ge *page, void *addr; =20 WARN_ON_ONCE(!PageUptodate(page)); + BUG_ON(PageCompound(page)); BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data)); =20 addr =3D kmap_atomic(page); --=20 2.26.2