diff options
author | Darrick J. Wong <djwong@us.ibm.com> | 2012-05-27 08:12:12 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-05-27 08:12:12 -0400 |
commit | c390087591dcbecd244c31d979ccdad49ae83364 (patch) | |
tree | c3ccbd028cb7970070114a8b0f45adfbebb113cb /fs/jbd2/journal.c | |
parent | 1f56c5890e3e815c6f4eabfc87a8a81f439b6f3d (diff) |
jbd2: checksum data blocks that are stored in the journal
Calculate and verify checksums of each data block being stored in the journal.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 9072f03d30b5..e9a3c4c85594 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -2097,10 +2097,16 @@ int jbd2_journal_blocks_per_page(struct inode *inode) | |||
2097 | */ | 2097 | */ |
2098 | size_t journal_tag_bytes(journal_t *journal) | 2098 | size_t journal_tag_bytes(journal_t *journal) |
2099 | { | 2099 | { |
2100 | journal_block_tag_t tag; | ||
2101 | size_t x = 0; | ||
2102 | |||
2103 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2)) | ||
2104 | x += sizeof(tag.t_checksum); | ||
2105 | |||
2100 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) | 2106 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) |
2101 | return JBD2_TAG_SIZE64; | 2107 | return x + JBD2_TAG_SIZE64; |
2102 | else | 2108 | else |
2103 | return JBD2_TAG_SIZE32; | 2109 | return x + JBD2_TAG_SIZE32; |
2104 | } | 2110 | } |
2105 | 2111 | ||
2106 | /* | 2112 | /* |