From patchwork Thu Jan 2 22:06:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234764 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 4D8B0C3276D for ; Thu, 2 Jan 2020 22:20:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 190262253D for ; Thu, 2 Jan 2020 22:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003637; bh=V3dVkhxjE4e30OhRhtsDseRzbnQeEmmeGqu7vSNtaNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VFjQaKc380WHZ/q9zjamGXaoPKG/nWsu+CWbqOLC7AGoFvo7qIBpwx7qdR8pf+Xp1 pi4nTsoNCOxHeFt9iJHgU8H4talkdS2ZNbZldhQr/Zd6nKdtHPHfbx3ODOYOMINYE6 cU2MM7dyikKKjpvCiEc26gfqrVZy1+9xfQl6G4o4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgABWUf (ORCPT ); Thu, 2 Jan 2020 17:20:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:38314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728609AbgABWUf (ORCPT ); Thu, 2 Jan 2020 17:20:35 -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 4045B2253D; Thu, 2 Jan 2020 22:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003634; bh=V3dVkhxjE4e30OhRhtsDseRzbnQeEmmeGqu7vSNtaNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mh6seBUKKwGkclQwGxCmeylfOi/2nnigth2Yot+yxmyJUTrlGaR3vpbRX3+6kq44U aM4IT2No30FJP4PLgHkpbFJaSJaPDoEv9BVhQM9DyxkcXDGyOYUowUtjVa++eKPJWi Q94FFOlEbiKUYsqkUaMJCTjwSJT8m5KwOQgi0XVM= 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.19 024/114] jbd2: Fix statistics for the number of logged blocks Date: Thu, 2 Jan 2020 23:06:36 +0100 Message-Id: <20200102220031.569867814@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 24f86ffe11d7..020bd7a0d8e0 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -724,7 +724,6 @@ start_journal_io: submit_bh(REQ_OP_WRITE, REQ_SYNC, bh); } cond_resched(); - stats.run.rs_blocks_logged += bufs; /* Force a new descriptor to be generated next time round the loop. */ @@ -811,6 +810,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 @@ -856,6 +856,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 */ } @@ -877,6 +878,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);