Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11815242pjo; Thu, 2 Jan 2020 14:46:08 -0800 (PST) X-Google-Smtp-Source: APXvYqy9WqHW890koHH7q/daTbUwJqZIFtn66hIMawGtRidZTr/9BfdSG7xGIGiv8jYaXnPZsi2Y X-Received: by 2002:a05:6830:124b:: with SMTP id s11mr93212696otp.333.1578005168086; Thu, 02 Jan 2020 14:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005168; cv=none; d=google.com; s=arc-20160816; b=DHx7DmjGSIyo7CmiJRAxd+z7R+z4s/0EVjIsnlSnC+GKvNTuReNwypeOd8CH+ZN+AC eushZ/QZsef59zKqLiVYAADV+FEnlNcGWnV7vHP+C49H3gAT/JfHxA48p4x1kDY16lZG pGWNBxVTTEZwdpV7Y9lvlcftsrK6QrMff2MYkGE3QBOTyuPcIWK336zj1X1orw/p8YHi WqzP+Pc98OIWk7CcSD0zgpisshx2JkIdDCvAn64PqV1xQj0ncaCnLTzeIA8L+TifSjlx 9VZGE7qgx1H0LyqYNuRJFR4olpfjpDioR6Ap6AzuIQ0n7ffTfNbQfVu96/0ISRUhtDPc aAwg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hsCggiJEgY5QYfAYCwzfiZqJ3+E8p79PWycRo0Giz4U=; b=htQUNTPDs7kSWYD+0CZ3TkxgxM6hogZ4UAcuoLOEXoY59oGeI1hgvTly39HAShr79T RuBpGM2WSSwEI3gH0fHAJ25p3gzm9pL0xdMwIyBQQX++h34X4gB92fwjAl9aZyPkRCXG /iyLvr/FHPVCHvlWplij9tfUNXd/UG1kBJKKBKG4tp4AWWX2ojgTcr4mly1b6lp/YZDW zn6kIHw2jHR5NPlDD5rckhqZj7sA/jHdFnRVSqLXgcqG1hP04PAHeuY01k/HOaE99eCx 6d+Z2HzOhxUrgf0+CUBjBWablp6M1RQpcahBVgm++wO4LFDaLYirHV+n3/aZOxIQFXM7 pm7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dL3fFZyt; 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 w18si31939661otl.54.2020.01.02.14.45.56; Thu, 02 Jan 2020 14:46:08 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=dL3fFZyt; 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 S1730736AbgABWob (ORCPT + 99 others); Thu, 2 Jan 2020 17:44:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:40424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728656AbgABWdN (ORCPT ); Thu, 2 Jan 2020 17:33:13 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 295702253D; Thu, 2 Jan 2020 22:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004392; bh=nQpDlb/QRMrZp3wBuF1KQmuH+uhXqWFy8UzLG5aEIso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dL3fFZytK8Z2gipKajJcaP9B6plafAfoK9fwbgbEau9VlMkA+qMXdHRUI7jeDEnzs HOBVrv0jm5lEuEs3LJGkdeDjcu0BYfrbXGYWDvllLaSHisgpkiCk2CROu3Zrqr1+jS j9xrA4uTOO7ldPAgAi2iwjtX+oeZ0Wa9MrLdANaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , Jan Kara , Sasha Levin Subject: [PATCH 4.9 124/171] jbd2: Fix statistics for the number of logged blocks Date: Thu, 2 Jan 2020 23:07:35 +0100 Message-Id: <20200102220604.294058268@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kara [ Upstream commit 015c6033068208d6227612c878877919f3fcf6b6 ] jbd2 statistics counting number of blocks logged in a transaction was wrong. It didn't count the commit block and more importantly it didn't count revoke descriptor blocks. Make sure these get properly counted. Reviewed-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20191105164437.32602-13-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/jbd2/commit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 10ec27676191..d002b2b6895f 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -722,7 +722,6 @@ start_journal_io: submit_bh(REQ_OP_WRITE, WRITE_SYNC, bh); } cond_resched(); - stats.run.rs_blocks_logged += bufs; /* Force a new descriptor to be generated next time round the loop. */ @@ -809,6 +808,7 @@ start_journal_io: if (unlikely(!buffer_uptodate(bh))) err = -EIO; jbd2_unfile_log_bh(bh); + stats.run.rs_blocks_logged++; /* * The list contains temporary buffer heads created by @@ -854,6 +854,7 @@ start_journal_io: BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile"); clear_buffer_jwrite(bh); jbd2_unfile_log_bh(bh); + stats.run.rs_blocks_logged++; __brelse(bh); /* One for getblk */ /* AKPM: bforget here */ } @@ -875,6 +876,7 @@ start_journal_io: } if (cbh) err = journal_wait_on_commit_record(journal, cbh); + stats.run.rs_blocks_logged++; if (jbd2_has_feature_async_commit(journal) && journal->j_flags & JBD2_BARRIER) { blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL); -- 2.20.1