2024-04-04 13:37:59

by Wang Jianjian

[permalink] [raw]
Subject: [PATCH] jbd2: Add a comment for incorrect tag size

journal_tag_t has already counted the checksum size, however, for
compatibility reason, we don't fix this bug and keep it as is.

Signed-off-by: Wang Jianjian <[email protected]>
---
fs/jbd2/journal.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index b6c114c11b97..b5e614818e8b 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2698,6 +2698,10 @@ size_t journal_tag_bytes(journal_t *journal)

sz = sizeof(journal_block_tag_t);

+ /*
+ * journal_block_tag_t has already counted checksum size
+ * but for compatibility reason, we keep it as is.
+ */
if (jbd2_has_feature_csum2(journal))
sz += sizeof(__u16);

--
2.34.3