Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6044796ybp; Tue, 15 Oct 2019 08:48:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOS/erO5vvMpvh9dTbSyOR1NdpG/z2F+brl+ZkkZsUrR/6yQk6npj963ygyWB47ABPlwrh X-Received: by 2002:a17:906:5502:: with SMTP id r2mr35779624ejp.3.1571154499352; Tue, 15 Oct 2019 08:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571154499; cv=none; d=google.com; s=arc-20160816; b=DgdMQtT4whj9C+gEOexuiaiJqbJt1w6Va1wCiGyAp+pv5hmJjNlbPxrR2emssYYBXZ PfWnjuxNibvtoOPzfU+528rxcFLP9yvErkTaiOwN+rSCu/D88ahEpKSf8Nx3t3oyTrSM 5gD+t3rTG+1SkSrZKVOlNqotwEv67p2Vsu1dtJqQTB/Wjdx5WOW29yqqOZiQoByb+c6E iK+nKfgbL9DfZ9dHionc/PM3h6EMtoe3d3AgAjis7mQCJ8ePDtP/h38UG4rz8+ktaroP bdYtPmFm9exzg/DNkWqBmnfOYl871u3Y6hPp0ZSpatUWUphcQuNJtMbP/LyaTL+uYYGH Nykg== 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=PyfFUuGfa7iOeQdg2tlHNvnJmFmD/Bz+PVXi53q6+CA=; b=PajLmADW1Kgn3FdDxk623Ejp6dFVyS75xiGzdcZabnXdvdRYL32p07T0C3VXtf8Gaj 4lfzr8YBJ3j72uwblfh2htaLcHU1Y6sjWemN4fXAdX1VIQG5du3wwODswvKmOocFn97s RXHfz5uMy4+/Yw5O67RlQjv2OFJko8LOmZwUxh6V5LwZobNiGXZWQyVqoi/ZEUOxzbrl 3gfU+wm0SZbZ0ZBtt4nHNLvJzaioW6nKpKEMzsJshuOrOPSmiFvy4f85HAWtwPnXrPP+ JoJVJ7tTYHqC7Mm1R5+C+kq5tVzu6D8JkeOAhL4Vkj/s+RAeUd0fDJ+e+vCppnNkHz2t mQaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qOYNFFkT; 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 w14si13331043ejv.112.2019.10.15.08.47.56; Tue, 15 Oct 2019 08:48:19 -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=qOYNFFkT; 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 S2387756AbfJOPog (ORCPT + 99 others); Tue, 15 Oct 2019 11:44:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48136 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387691AbfJOPoX (ORCPT ); Tue, 15 Oct 2019 11:44:23 -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=PyfFUuGfa7iOeQdg2tlHNvnJmFmD/Bz+PVXi53q6+CA=; b=qOYNFFkTkILIQ4Rp1K31m+/8Wg b8B8wVR8yKYwQs7njFCn1qvo2iyBWc+p6EE/4er6aQ4Sfkf0ihuvYUZB6sGbu9ZGfYs0aFcQZMHC5 fIEMeGjWW5jeW7542lg3pjtvqnO0lvAfOBkNPlRTCQdHe0eo3TzFCUKu7T08nAJp1xLH7+q2AJNrI coK/VcfVkYcHCtW7YHaezXoN6l/g3GHhUWyyIM8/DZBWr1g6xtPVL8TQ1XOjvxLrVZlIDng9fNPzx lgQUDZRLKmsmB0UUXX0BYpCH3CZqgWNhT+IyOUZ2+DYLUsOisEDgjsWKFMs0oBt7iL4vTBBJkhAaJ iufrPj2Q==; Received: from [2001:4bb8:18c:d7b:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKOzk-0007zX-DB; Tue, 15 Oct 2019 15:44:20 +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 10/12] iomap: warn on inline maps in iomap_writepage_map Date: Tue, 15 Oct 2019 17:43:43 +0200 Message-Id: <20191015154345.13052-11-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191015154345.13052-1-hch@lst.de> References: <20191015154345.13052-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 00af08006cd3..76e72576f307 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1421,6 +1421,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