lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250627212451.3600741-1-zhangjian496@huawei.com>
Date: Sat, 28 Jun 2025 05:24:51 +0800
From: zhangjian <zhangjian496@...wei.com>
To: <tytso@....edu>
CC: <linux-ext4@...r.kernel.org>
Subject: [PATCH] debugfs: fix printing for sequence in descriptor/revoke block

When cursor cross the last journal block and will dump old journal blocks
sequence number will be lower than transaction number. Sequence number
should be read from descriptor block rather than accelerating transaction.

For example:
A snippet from "logdump -aO"
===============================================================
Found expected sequence 6, type 1 (descriptor block) at block 13
Dumping descriptor block, sequence 13, at block 13:
  FS block 276 logged at journal block 14 (flags 0x0)
  FS block 2 logged at journal block 15 (flags 0x2)
  FS block 295 logged at journal block 16 (flags 0x2)
  FS block 292 logged at journal block 17 (flags 0x2)
  FS block 7972 logged at journal block 18 (flags 0x2)
  FS block 1 logged at journal block 19 (flags 0x2)
  FS block 263 logged at journal block 20 (flags 0xa)
Found sequence 6 (not 13) at block 21: end of journal.
===============================================================

sequence number should be 6 from header->h_sequence, rather than 13 from
transaction accelerating from jsb->s_sequence

Signed-off-by: zhangjian <zhangjian496@...wei.com>
Signed-off-by: zhanchengbin <zhanchengbin1@...artners.com>
---
 debugfs/logdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index 324ed425..56f36291 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -532,7 +532,7 @@ static void dump_journal(char *cmdname, FILE *out_file,
 		case JBD2_DESCRIPTOR_BLOCK:
 			dump_descriptor_block(out_file, source, buf, jsb,
 					      &blocknr, blocksize, maxlen,
-					      transaction);
+					      sequence);
 			continue;
 
 		case JBD2_COMMIT_BLOCK:
@@ -545,7 +545,7 @@ static void dump_journal(char *cmdname, FILE *out_file,
 		case JBD2_REVOKE_BLOCK:
 			dump_revoke_block(out_file, buf, jsb,
 					  blocknr, blocksize,
-					  transaction);
+					  seqeunce);
 			blocknr++;
 			WRAP(jsb, blocknr, maxlen);
 			continue;
-- 
2.33.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ