Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7948358ybn; Tue, 1 Oct 2019 00:19:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS4E0EFDYTkx0XtKFZ9CmLKasSnV8iig8SU+rt14gOcLQ99iL0s2DsxT830MBViFYgpGEL X-Received: by 2002:a50:b6c8:: with SMTP id f8mr24037057ede.33.1569914344772; Tue, 01 Oct 2019 00:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569914344; cv=none; d=google.com; s=arc-20160816; b=A/jmUspGfbYkaaEmXyk5zWDA/yfzMmggZKTKVpLIjOiE0gVrPRMsDIcY+Tqb0Hi/if OrOaoQvrSKb1jhhO+EiPV6zpBkQO/dIDchFZBi+5BF5oKEkB7wZtCfdFrXOwl5nb8ttS pIDD6uSIqsFoGCk9/6655avN8sytT4mc1k0OEHK0OKRI86DwVV+f6AJ2ffDgLOx87AOI pKVt2ULNbwCmPy75Ha9iaVwMb9o7/2zoc3xX+OV2ArUJ/LgHEzuBcEu9uI1OeN25SYKY 99jd14lIUUWX7OxU8FWR1QplQGfRA605hDGiMVeZ9Dsp745f4HA4LU+FZgkt0cDtH4C1 6S0g== 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=F1Xg/3Bstl/oXGREMdfRTRgkyVyVzAnBeGlW0zeMdeU=; b=gL71oHe/DPdTyX1AC9jwEgP704F/y+oopwP/sl+RgcKfTZudu4yH8lucC1IsAUGY7U FmpbXIkBNa6MygyWGhAyaB9WKxEQ6BuAKb0NiKR48meCKZlhtPYYP+SdjBobOMQknkP/ KgB9eshfPGQqSQ4+eXJ8X3BP7AzjoCmA2MrLvA3htj+GQx81ggIH1urngsLU4o+D/kkm 1u6eN6NX9vxzFgEOEkVxNFOVErry3f9H3iv9F0GLMjd3lYnmCsGfhAaftzkAjCO9q4+I nVW43WH414MqWjNMGP0DhPTd2h2gM1fyby9vJx0gXCoFh4C2kHgeDa7eR+eiSgGeNwca Tyyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="DwSd/0TP"; 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 ox13si8565797ejb.0.2019.10.01.00.18.40; Tue, 01 Oct 2019 00:19:04 -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="DwSd/0TP"; 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 S1732932AbfJAHQZ (ORCPT + 99 others); Tue, 1 Oct 2019 03:16:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45490 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732829AbfJAHQZ (ORCPT ); Tue, 1 Oct 2019 03:16:25 -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=F1Xg/3Bstl/oXGREMdfRTRgkyVyVzAnBeGlW0zeMdeU=; b=DwSd/0TPYkqmxarbKknwj8A42c OOXfBr2lEt6dYv/NAA/kvpvJ5zxYAtpZ29cmdHP5QBEi3rhwlQPIk89bxkICZgBKXt22VYClfL3PB VuUPzc2vlbVv9fx5rpV9YFY+ErPybzEY7dz6QL2zQLjZwUY9JZuw3diQb5kMGLHuvpI5Dp/iSG0vI WoZNnozoqbF7EAOhMLaGGxLYubLRdGi9SyqSQJiqTvMuhaOeaVhjQERz3StrfIJwJS4A+4h4YRfZI milyJH8pgcjfJ8DX3fe1xA+rXiXclZBB7ygtV1ieALmX8iGfAeCj2x6qE56cSakp2cw/EeYen0tCm MJ27k6fg==; Received: from [2001:4bb8:18c:4d4a:b9e5:f9f0:a515:3f0a] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFCOU-0001Ph-8Z; Tue, 01 Oct 2019 07:16:22 +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: Tue, 1 Oct 2019 09:11:44 +0200 Message-Id: <20191001071152.24403-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001071152.24403-1-hch@lst.de> References: <20191001071152.24403-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 3444f968e739..61f067b3261b 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1409,6 +1409,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