From patchwork Wed Oct 14 03:03:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11837177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 416F915E6 for ; Wed, 14 Oct 2020 09:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1123D20BED for ; Wed, 14 Oct 2020 09:23:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Hqnk7nD/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731173AbgJNJXO (ORCPT ); Wed, 14 Oct 2020 05:23:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730736AbgJNJWw (ORCPT ); Wed, 14 Oct 2020 05:22:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14B00C0F26F4; Tue, 13 Oct 2020 20:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=sU/fZV47iwWzgioCKRXJ5YfzflXRPUbnphxuAtGKKLU=; b=Hqnk7nD/NpsmPqpAxpI/NTmhdZ okkum/QWQxjmat6HRVOilaBBz+DBF43Mm3+Mz99+kL3C9NzzVr5YwWzl8ld9twDHVYXd6fWOefBsD 9t4NoSgsIW09ZHFMrlNbPP2beVE04RB/2P4201oEzGtwFCN0XHIv5MknHziksLxJto/R6dYXAINtD nA+eVJLMJUJ4pIjfUPjz2EIyojC4B8lHtiCkQ1PZjfT1zVpF5qSipBBCNgBbqcr7MIM6wbLK8uTt4 CPGIuBXGY1YND6XlfNGzBjluBLCwrDJvG5l+YrE5n0Dih0YXWdFErsc/Kkr4uPZ1prbmRIrJA3l0+ kjGk8B7g==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSX58-0005jV-Ht; Wed, 14 Oct 2020 03:04:02 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 13/14] iomap: Handle tail pages in iomap_page_mkwrite Date: Wed, 14 Oct 2020 04:03:56 +0100 Message-Id: <20201014030357.21898-14-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201014030357.21898-1-willy@infradead.org> References: <20201014030357.21898-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org iomap_page_mkwrite() can be called with a tail page. If we are, operate on the head page, since we're treating the entire thing as a single unit and the whole page is dirtied at the same time. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 38b6b75e7639..c2540c85f629 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1098,7 +1098,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length, vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops) { - struct page *page = vmf->page; + struct page *page = thp_head(vmf->page); struct inode *inode = file_inode(vmf->vma->vm_file); unsigned long length; loff_t offset;