Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1283387ybg; Fri, 18 Oct 2019 15:11:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmjAeGmRWUTY9vkW6UggZ79k5mGVVaiwntmxag1F992+IKj1tnc0Q6S+2eDgwex2DSbi5X X-Received: by 2002:aa7:d0d5:: with SMTP id u21mr12373530edo.36.1571436695621; Fri, 18 Oct 2019 15:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571436695; cv=none; d=google.com; s=arc-20160816; b=ZV+Y7uT3wgiN9c5cVDPhpf2Gm2h/7+f88omB5w37CmJbzX5LxcWmbRvr+3VzA4h0mY GhY4PyLngnUwQCMZHFyoXqwsFJ0brvmvSwC9qJ++zcuTiUez9GCO2ER2xezO7jhYtMOD CG23AQkc2HLxY3XlDBuc195GUli0o5ZtPVE1MNlSE9c7PVJsiiO7vBoiQhT6bOqPCv3O DWb08SkuTEOhBLW6ZXj+MQ4xcjJQg7p9WE+N6asQYtT1qtqmp3L0Nmf8dKO3rwLUzgT6 LihmeVEqU5apGRFVvUGazolDZ5+Fl/hGOv96dxBB/3oaVHPhpT0LdPhffS7p5//iE5HI j/3w== 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=EHnzXlsMN0msZ+wyMdG2M/WDx59W2fryIi7yaC47l/4=; b=UEkF96MPqIIVKhHAT0vzkjjeQTcsa+TC4ckIS74pEY1JZOIO2GaP/jbhp21pv0csFR Eam2auWbl1FKLPsHL2HPG5UFhPchCvTkr6w0SheREO+C5rdRyAEuru89Ecg5B84XcdAP xFf9rMUUC8uBRh/hdQeET4CmfvmvoJTDc28DJaPwdoEKbv/6pxWtnsYKkzmVCOvcIbgI bBf+LrtCxwMFG4UGxwqapy1RHk60LUdb/pwmiyJo9sJz9rSnBDYklmx2YFu29AH8D4wQ T+W94Hd/ZIqlOEDKrkumCith4EmA2h/jz/xRZM14HhT0JcVNp1e3sKnlnWdwhDYzsSQg t/5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IaML3xtc; 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 t9si4163706ejr.29.2019.10.18.15.11.12; Fri, 18 Oct 2019 15:11:35 -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=IaML3xtc; 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 S2441207AbfJQR5X (ORCPT + 99 others); Thu, 17 Oct 2019 13:57:23 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49022 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441175AbfJQR5B (ORCPT ); Thu, 17 Oct 2019 13:57:01 -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=EHnzXlsMN0msZ+wyMdG2M/WDx59W2fryIi7yaC47l/4=; b=IaML3xtcIJaSHlcdd8WizZ10t0 5ya9OPm/vgTsylorycXl5B52uV2DT4L8DyGPur+GUJVCBlngOCH22LvGUwxP2mlUpel/4fUOexI61 bGM0nMaVhBmCLiuaXmldyI9ZRdatGIXneZK+oivVUwsztUMJ0DI0bXv6c5jriJiXC/cDGDN+SzAbj CbRj+XNyElRpiKoqp5ghqICSY2VXgHkj3gRxNRUfR0w/upXMtyMG5482fGe4S1rXGWwuug43knMxL i6FNJIkPaCsVk/fP4VcyzZlmG7r93y/Ob4pOpNF9zIXWja+QG7sw4aiVcNtwNMvrdB0L1fi9b8jjs rcvQowwg==; 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 1iLA1C-0001JA-Cb; Thu, 17 Oct 2019 17:56:58 +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, Dave Chinner Subject: [PATCH 11/14] iomap: warn on inline maps in iomap_writepage_map Date: Thu, 17 Oct 2019 19:56:21 +0200 Message-Id: <20191017175624.30305-12-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017175624.30305-1-hch@lst.de> References: <20191017175624.30305-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: Dave Chinner Reviewed-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 a8db706d59cb..7b83a7ba2edb 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1415,6 +1415,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