From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCF2BC43603 for ; Wed, 11 Dec 2019 15:38:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 899C022527 for ; Wed, 11 Dec 2019 15:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576078714; bh=NX0S9Qx6zPAjKxQOAmvpsNw3KnU41sQnZPjSKneBC6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cFFBFYXkC+1G+yg6k/DYoEyNW35vYdTCuiCtFSaFQ+ShLcb5obvCpnZyQMtqTM4NT 9+RCYw8GyjHA+A8WLXWsCRYmljopGfSMOofSiWrwmu6vFHAVouV3NZ0pCdufsOkAME OoNIU+eXHlG0BquocUicx61cbD3Q4vd+Irlzu364= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388451AbfLKPid (ORCPT ); Wed, 11 Dec 2019 10:38:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:48892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388309AbfLKPi1 (ORCPT ); Wed, 11 Dec 2019 10:38:27 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B176422527; Wed, 11 Dec 2019 15:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576078706; bh=NX0S9Qx6zPAjKxQOAmvpsNw3KnU41sQnZPjSKneBC6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qO8MM0Gz0D6dbNHomFBFDZweecZcR15HUv6bxB5e76VW6uGBNG2Fn2sgxSmiiO/fp uwBrnha56FJJliJstZh4fbVmHeHpkvelNsJd3rPLY/ZIj6qacq5iA/JV74/7LPruqP xVhQ7/tgSVFAtICukeOWTClq0EMMeU2FEvMZdLkg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jan Kara , Theodore Ts'o , Sasha Levin , linux-ext4@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 12/37] jbd2: Fix statistics for the number of logged blocks Date: Wed, 11 Dec 2019 10:37:48 -0500 Message-Id: <20191211153813.24126-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191211153813.24126-1-sashal@kernel.org> References: <20191211153813.24126-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 2d964ce456060..ebbd7d054cabd 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -740,7 +740,6 @@ start_journal_io: submit_bh(WRITE_SYNC, bh); } cond_resched(); - stats.run.rs_blocks_logged += bufs; /* Force a new descriptor to be generated next time round the loop. */ @@ -827,6 +826,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 @@ -872,6 +872,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 */ } @@ -893,6 +894,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