From patchwork Thu Jan 25 08:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13530234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2D3AC48260 for ; Thu, 25 Jan 2024 08:58:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45E328D000C; Thu, 25 Jan 2024 03:58:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40ED1280001; Thu, 25 Jan 2024 03:58:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 265878D0021; Thu, 25 Jan 2024 03:58:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 10F478D000C for ; Thu, 25 Jan 2024 03:58:11 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BD499120DC8 for ; Thu, 25 Jan 2024 08:58:10 +0000 (UTC) X-FDA: 81717231540.06.A534A89 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id 40532140002 for ; Thu, 25 Jan 2024 08:58:09 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=kPX9xF5+; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+b97a0fc658bf3e588113+7459+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+b97a0fc658bf3e588113+7459+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706173089; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pITNTbiyepqtlo8jP3CXnxlwUzR/Qf7OVM31pgQXB2c=; b=ZllVJEmANYw277TI4IfBDZhhG/7ssfTAIkyFoiICBdUMFhWAmEEIQeAGbJTD4na1Vv7ucE KJ4t1uqEoZuPLbPiAxv2zfR+Hc/h1f6qWVBt/+93+I99CsCaRPYgn66FO9qrnFKHVf718y 09JsvllGBAXDU9vWxktRnXZe1iUMP2o= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=kPX9xF5+; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+b97a0fc658bf3e588113+7459+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+b97a0fc658bf3e588113+7459+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706173089; a=rsa-sha256; cv=none; b=GgAPQ5RPpbm5tC5Swed+Eu7wKrhs2ByN6pr2I6ZG1h8WInhABuloFKPd/x0VIw6tGUuquF RgQALEhlU14uaKMDWlF0RIt0doOn+4pjHR/MxycLANQrsfI6aCErQOojXfTY/zoBUE2kPl htg544JiVaC19mZFPJ+EWipmtJ6uOrA= 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=pITNTbiyepqtlo8jP3CXnxlwUzR/Qf7OVM31pgQXB2c=; b=kPX9xF5+9DOPdosYkrB4Gr7OOk 5ZlGLcIDUkax96vrJCDbY/nuuyGiD6tZpyCwUUKBzMPUI5/FUH27SCTQnbKcPPH6k4pfwzuHB/NnW KiUHwflreZCIKmAfCsS//LnMJoJ4efOoi4Qk90nWwqnrKIFkYhMKyCywz/0/wE6Blsoboh4A0cXJL 6rZJlpqo6dJ1An7vfDAsSIWlqBdbYK5cAWqxNG+L+GTNFn5/gxRkOYOy0Of9iCKTXkeoH3GsUQFFG eugtxQofw3oW8cB3zk7+g7AX/EXuuPLtVV0s+b0Rb59uTXlN7SZWMh2Qq65VBgLd7ux0QqVdjPwWF WTjSr3mQ==; 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 1rSvYl-007Q8L-2u; Thu, 25 Jan 2024 08:58:08 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: Matthew Wilcox , Jan Kara , David Howells , Brian Foster , Christian Brauner , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Dave Chinner Subject: [PATCH 01/19] writeback: fix done_index when hitting the wbc->nr_to_write Date: Thu, 25 Jan 2024 09:57:40 +0100 Message-Id: <20240125085758.2393327-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240125085758.2393327-1-hch@lst.de> References: <20240125085758.2393327-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 40532140002 X-Stat-Signature: zihmthx1dekdixnjyq6mqyfok99msedz X-HE-Tag: 1706173089-38019 X-HE-Meta: U2FsdGVkX1/EZ/rOBpaSyhA3AS1VGriPnXCnMGGw7+biv1KBPepl2KXFT97zMSnyAtChQ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n3PwuxWKVK1EsFYINp8YxUTd768bH2Qr8nlUfeVezYKBwLYQufADrzcc+HQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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: 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 cd4e4ae77c40ae..ef2334291a7270 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) {