Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3294265ybp; Sun, 6 Oct 2019 08:49:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXm0fEYWgf/uUvpNuUxBxEed8g6dceapPKTTLNyNJmYzpY7O2JzX1+D2Lwm4QEdkUusZCv X-Received: by 2002:aa7:df8e:: with SMTP id b14mr25327617edy.65.1570376968398; Sun, 06 Oct 2019 08:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570376968; cv=none; d=google.com; s=arc-20160816; b=VjENyPZrlOA0b+evF5/VxzgX/7u+/3hrhvXPbIZ7N8yhrU1xbaGrmNW6N2PQoQMEYa afcL0H6txePAXJg2+5B5xE4oFdqMzWbhX8jvRX95VhN/wuWbjgCN12dBIAl6NyY9nmtI S3Ih1jNYFGbxK+MNAJ2zcZEa4nrqPNecpdi4MZgifMZObNF6wvIoo4P056CEEAKsTOYg b4FNX+vTEVMeZMFfSu3HvYQBr5trJSxV+LJ4jwkKmfSyxWl0Ps5Cw+Wxp8DMCLaX1kTa YPvDb6k1Ma/L2CUu+t2BqsNNeLuHnIPQupE3IdXdncwsaDOoJGCtect+NNqDpZl3YDFH UTPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I3cUiR6B2JnhWezciWT7dEv+8m8IojdDmdN/jSnvrYA=; b=EP5vpxj+HpNd2btzdu+iqv4GzexJFjfl9+YuWOY97mvsF8VsKNODRY1dzktEqISsTX kjYqSutlBjdOOUFUc0/75oW6URDiZkhg7iyMdpIpUVA5nmr9iGsAB8RHWtNtCoYICiPu Dmpss5fUZY61x5UolMMZYV1nRPVAnccuusP6+hwiuCi8Ad+1Y1rxAS28kLyki/ISika2 6QRNXK95ND4IllwbH9zBGbroQgCBVIMYf8quUkPNxfbdz6YMigSlJWQAGs3PBXemWfh6 IPvL2Hh6EpRAivs2WNJxhPytyX+z8m3Mg6KVXu4cl/0kWtfy+v144epR62c+tL4z97to cyhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Er1bxxlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z55si7350215edz.254.2019.10.06.08.49.05; Sun, 06 Oct 2019 08:49:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Er1bxxlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfJFPsh (ORCPT + 99 others); Sun, 6 Oct 2019 11:48:37 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53518 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbfJFPsg (ORCPT ); Sun, 6 Oct 2019 11:48:36 -0400 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:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I3cUiR6B2JnhWezciWT7dEv+8m8IojdDmdN/jSnvrYA=; b=Er1bxxlSVjLJEtcQCSOHe6u166 996zPPGjOkkbPWFglNxogk2Oay2CBkpiE8wDliHRkOOzuHHpaT0lbgX0EOsRd85jxsC9mjRpntmqT c9qOu9C/otvtHVZ5mKZGWGWjc6mRyHyT4r5voQbyON0qJXqKWpzyTf0zdst/2zF0A2hvGLKkbtVdm rcDGsxHQrHu8aJeGRuh7t9EGizxUWNMS/8YY1RLY5lmtojQIILUkUfmQ/LA1DLXLEl0iqoF99VkxL QHt5XJpBrAYlB66Vwv5BO7r9hfwA8+bABDWOgtQAUN7pRxz9Jnkpgw61006DDT+vYVGJ4jF7SFpiN RyskH3OA==; Received: from [2001:4bb8:18c:4d4a:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iH8lq-0008S0-Ad; Sun, 06 Oct 2019 15:48:30 +0000 From: Christoph Hellwig To: "Darrick J . Wong" Cc: Damien Le Moal , Andreas Gruenbacher , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/11] iomap: warn on inline maps in iomap_writepage_map Date: Sun, 6 Oct 2019 17:46:00 +0200 Message-Id: <20191006154608.24738-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191006154608.24738-1-hch@lst.de> References: <20191006154608.24738-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org And inline mapping should never mark the page dirty and thus never end up in writepages. Add a check for that condition and warn if it happens. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- 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 7f19c8ab3592..23cc308f971d 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1402,6 +1402,8 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc, error = wpc->ops->map_blocks(wpc, inode, file_offset); if (error) break; + if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE)) + continue; if (wpc->iomap.type == IOMAP_HOLE) continue; iomap_add_to_ioend(inode, file_offset, page, iop, wpc, wbc, -- 2.20.1