Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2324495rdb; Mon, 12 Feb 2024 00:19:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX4GVNxuEvjhsZX8sInYE6M8qlXzS1vRILVbTIWQz0y3UYJi3mcOTfQ5nTBsld6wplBNn/+w5ZNS0TGqi098QTHBzqNm4H7rFgs6EA9Zg== X-Google-Smtp-Source: AGHT+IEfl45+hCpWgT0ESRrfhD4GTp12gNIsByN+RZNw6G914gAYo01e8sKnucTjfc1cPiqbvj9w X-Received: by 2002:a17:902:a3c5:b0:1d9:f83e:3a54 with SMTP id q5-20020a170902a3c500b001d9f83e3a54mr5578709plb.64.1707725972384; Mon, 12 Feb 2024 00:19:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707725972; cv=pass; d=google.com; s=arc-20160816; b=xzwKSZTxIVP5YXZGyfsYMM/D0tIhnRMLhZtHiXJZOMLcx4EkduoS/bhtgTFB5q9N8e KCjblrdo9mQPQs9payZvp1QRT0H7z0AwvJ4AMJ9PqbXl50jzEl7npQMAL92FCMMDkJwl Jv9R96DMxWNWwcUECXjlicmC6E0YitUdRshjOdLlejx/PZK8iE6mWG0zTDda39tiaYoo Odsj31jCpFqMtkqsgzQLQj6af8b4aEMDSIHvg4wONnzM3sg/WNNlaMR4Fn5Lxm717RkJ 45trgDvgSlFadhkPTZA+TpwscfYK3WIoNTp3oI97qNqlY2a9L4mFtdhrmVzX0stDeRsz 9jyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=64fRIZ4p3xI47I0UjDfQWbOQW89h4igNM/M4APDkPmk=; fh=09NQnwTfk1zHLtq3lcXwuymaeMQ+FyWkJwvD6xWs5qA=; b=odryC6J3q+/dstknCHhjC8xLyrhzk1+K6tfU3WBvHKSnriy9TXjeRlYA7onlecCUf5 ZUGX0MYCNFYSzbS7SrvnircAlQOrnXq5Q/HZkSN5iOpucr3WuNQQLn03flLhHpZCeoAw BlFZDLKm4gXZk7UF+XvxNFkJ79ZuHHRQ6WoQ/gA4uS86S+EbeCcN2UBdUvz0KRjdDM/B hKzyaHxcX4T956GuZC8tSSoMdgm2b3pQEeLbd2kuH0LCOxxMX1VJpkXOeYgtJZjO94Yl ftJGMlOgqhXB7Ku4a+Z/8MI1xAvoudU717Ge/49IwuOIqKkTWMbX5DBfLbtlJchPX4Lu 8onw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=hQnFDH25; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61129-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCV9yqSxCTZ4ihVtCn+e6pFRFeg/Z1aO2zr2PpJ/1ZcExjSObwNzQFdCzSJWjfwbTcX61UK23M8w5mW+13TBRfDhqT6myo/6BA95hoT1hA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j1-20020a170902c3c100b001d919be90f8si5916366plj.132.2024.02.12.00.19.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 00:19:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=hQnFDH25; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-61129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61129-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 028802833C7 for ; Mon, 12 Feb 2024 07:15:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DC8710A37; Mon, 12 Feb 2024 07:14:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hQnFDH25" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169D310A0A; Mon, 12 Feb 2024 07:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707722051; cv=none; b=nq5034kbkSChHFEdNGLOo+U8Cr1y0GTYhhNMD+n+CXyn70GPLraXQDD/GGTspgNmEgroA+313s8jjk+gN586DQCYD1ph07XxwWHVdn+G+3YHWr5OPE7Rfz4KTyOmMk2uPZoy5rdKOjzadetmOu6OVrxIQjqgDmnucqxJVijEB6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707722051; c=relaxed/simple; bh=qDZNRvNkd4jQjG015zJAhoIiQiTD5FYJGjIDp41iL4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B88gtsj4RUMcL8B268vib7RbKu2/3Bby618SzmDhZ8wvIb0CesY2XPLyQbVNo1VjncyMKOkIhLJsUvRdF4shRJF9GfVTjbWZAhgQWd+y93it3AQdU6LvPNt6AkZZ/7i2oT/ajkKAOfHtNxBV6qr33/gX+lzKqKBz8d12I91AGhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=hQnFDH25; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=64fRIZ4p3xI47I0UjDfQWbOQW89h4igNM/M4APDkPmk=; b=hQnFDH252tFU20hQNpYyUplf2R jumeUc/X4ZUzuexuSNHm/zyXaPRqcggyQGFdoyLASrp+lMWu36MwQwZda9DfA0i/tGTxurxcVuYk2 7vQX8a5ep+6PGO+lgk/7ZmNu31DToIMDnMWWY+Inpo4BxJEsJm3nuNY2w1S2m/Udr5dnhsz4m+w3g hzaOAlGV33RWtrmBE7qG4n77S7sz8swMFa3bkYWn2FVEhrxmydbyy+8dvY+/NHpSd8nKTnUt5B4MC VAQhbSlVmXb6BrgLz0ZDBvn5840bRz3glHriIl64SpSG9IT83gI/0PvG0Y+zfo6FPqO9mOGthd9Ck GyUqemog==; Received: from [2001:4bb8:190:6eab:75e9:7295:a6e3:c35d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZQVw-00000004SpN-2Uys; Mon, 12 Feb 2024 07:14:06 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: Matthew Wilcox , Jan Kara , David Howells , Brian Foster , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Dave Chinner Subject: [PATCH 03/14] writeback: fix done_index when hitting the wbc->nr_to_write Date: Mon, 12 Feb 2024 08:13:37 +0100 Message-Id: <20240212071348.1369918-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212071348.1369918-1-hch@lst.de> References: <20240212071348.1369918-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 When write_cache_pages finishes writing out a folio, it fails to update done_index to account for the number of pages in the folio just written. That means when range_cyclic writeback is restarted, it will be restarted at this folio instead of after it as it should. Fix that by updating done_index before breaking out of the loop. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Jan Kara Acked-by: Dave Chinner --- mm/page-writeback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 62901fa905f01e..aa3b432f77e37a 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2505,6 +2505,7 @@ int write_cache_pages(struct address_space *mapping, * keep going until we have written all the pages * we tagged for writeback prior to entering this loop. */ + done_index = folio->index + nr; wbc->nr_to_write -= nr; if (wbc->nr_to_write <= 0 && wbc->sync_mode == WB_SYNC_NONE) { -- 2.39.2