gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: gfs2@lists.linux.dev
Cc: aahringo@redhat.com
Subject: [PATCH dlm-tool] tool: ignore file header on lockdebug
Date: Fri,  5 Apr 2024 13:46:18 -0400	[thread overview]
Message-ID: <20240405174618.2277289-1-aahringo@redhat.com> (raw)

Since kernel commit 5beebc1dda47 ("dlm: update format header reflect
current format") the headline of some debugfs entries was updated to the
current format so it is possible to lookup what - what is instead of
looking up the source code. As side effect there is now an ugly:

print_rsb error rv 2 line "rsb ptr nodeid first_lkid flags
!root_list_empty !recover_list_empty recover_locks_count len

in front of every lockdebug dump as dlm_tool parse everything (including
the file header). Afterwards the dump proceeds. This patch will ignore
the first line of lockdebug in dlm_tool that is not required for
lockdebug pretty printout.
---
 dlm_tool/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 2e6810d6..5878ebc5 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -1085,6 +1085,10 @@ static void do_lockdebug(char *name)
 	memset(&summary, 0, sizeof(struct summary));
 	memset(&info, 0, sizeof(struct rinfo));
 
+	/* skip file header */
+	if (!fgets(line, LOCK_LINE_MAX, file))
+		goto done;
+
 	while (fgets(line, LOCK_LINE_MAX, file)) {
 
 		if (old)
@@ -1114,6 +1118,7 @@ static void do_lockdebug(char *name)
  raw:
 		printf("%s", line);
 	}
+ done:
 	count_rinfo(&summary, &info);
 	clear_rinfo(&info);
 	printf("\n");
-- 
2.43.0


                 reply	other threads:[~2024-04-05 17:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240405174618.2277289-1-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    --cc=gfs2@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox