Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp10108rdb; Mon, 18 Dec 2023 07:36:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEghzKWpDiZ6Ef5paMy6s7CzYqmCHy1wIGPSx6p1nRfC231fw060Xo3S7ck4A8+kGCc+sGD X-Received: by 2002:a05:622a:1903:b0:425:4043:8d51 with SMTP id w3-20020a05622a190300b0042540438d51mr17773453qtc.108.1702913806785; Mon, 18 Dec 2023 07:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702913806; cv=none; d=google.com; s=arc-20160816; b=qceAYnn3ayjXUTuEEPM7G8N6l3lrmgjD+1K0ScgTxtCgtwpP2MHG4OGEIeIAvqzkdQ 7HOABoTNP6D6aPvciN9aOTM0YNPwvQx8nqNvDX2VdcixUccVS7vz5oOOmpXGjkOEh6W5 n5qd1mUqrteAQ2x9jBgG2wF41P5PxeDU0rPKnlFBx/XBQqkbOa4G51Eohy1+93oc/m9V NEzsAfzchr9CK1SUml3NQEBMpaL7+PBb9j1hdsBR8ecJSzGjG+mClZtxonUOTGrO3qBs 3tk+HjctZkYHauxqghADc2uPaDUElIB3JC3iJAm+3nvqadT0DjFTRlYbLCvD457BDGMx zL5g== ARC-Message-Signature: i=1; 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=fOpePqIlVODGcmo3HFeeBH3g3RORLTSl2mjzxWXksuo=; fh=m0HBXuwgOCKat7wyuY7vstPypqMqxNmINnjBv5+EUjU=; b=X3gIasRtaZJIodckJ6NQ+8DJ0ZV/R7u6uOfelTinyeOdPfyy3Ueqn5seFREj+th56X 2nFHjmg0RMVwv2ao2P9/uonCD1Ms+4cAYQarq/J4pgwzAleCuRukHW4qrL/Wpxi3Tvtc oeEy6OJ1ev8iQBP3/A9N8DTMYvb0M3p+gdqTPCNlKxR+KeeQRqYsMIf5VtrekGr4xrix xXws7LDFHqJEz2aZPF1jRPCHwISCCPZwhM0PRr8tO+ZOw7c0hPeZC3FHGFJ+2yP+46Zy u221wzprl3d46xXYPypwqX96Q0rpm7No6TJm5HkFV+wpIRad7gfwmLnr2dNE/yjZh0Jv Q4bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="ef/z6OGi"; spf=pass (google.com: domain of linux-kernel+bounces-3944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3944-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a11-20020a05622a02cb00b0042574ea09e3si17766712qtx.429.2023.12.18.07.36.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="ef/z6OGi"; spf=pass (google.com: domain of linux-kernel+bounces-3944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3944-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7EEAB1C23D89 for ; Mon, 18 Dec 2023 15:36:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5995498AB; Mon, 18 Dec 2023 15:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ef/z6OGi" X-Original-To: linux-kernel@vger.kernel.org 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 D8C9A4236F; Mon, 18 Dec 2023 15:36:00 +0000 (UTC) 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=fOpePqIlVODGcmo3HFeeBH3g3RORLTSl2mjzxWXksuo=; b=ef/z6OGiym6VMWNndQHzrgSssf EBETFKYXoYJJtNq1C9mH3HuQTgUYIICMzdd+RJk8f+bqPeZKgzvB9r5denj/kjl/6Rx1laQB+QPKl DO3ufG2jER5Chm9x/qyjOt395t6P9gk68QkXovUQH5R59J5O3aMBsHkdqZnw8EXlo+8WSOXh2CyCo mGbZti/G13+GR2IhJD4QsOC5HvnTbrBUPuDxuY/KTbu8mGypWYmtg04XB2h+fqEHuLSDGv7gKBIqB miSSHI1Dm4Q6uZ/1EpT8SkEKNlarqS5kEziIicr0rCyU/RxykqvJqeHnylZgKnTxUOQqQ9FAasDJQ 4J/FaIDg==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rFFev-00BEH0-0h; Mon, 18 Dec 2023 15:35:57 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , Jan Kara , David Howells , Brian Foster , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/17] writeback: fix done_index when hitting the wbc->nr_to_write Date: Mon, 18 Dec 2023 16:35:37 +0100 Message-Id: <20231218153553.807799-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231218153553.807799-1-hch@lst.de> References: <20231218153553.807799-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_inde 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 --- mm/page-writeback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ee2fd6a6af4072..b13ea243edb6b2 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