diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-17 17:55:01 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:31 -0500 |
commit | d6b32bbb3eae3fb787f1c33bf9f767ca1ddeb208 (patch) | |
tree | ce38de666096f571f4b1754e898729cf2d9eb435 /fs/ocfs2/blockcheck.c | |
parent | 684ef278377725d505aa23259ee673dab9b11851 (diff) |
ocfs2: block read meta ecc.
Add block check calls to the read_block validate functions. This is the
almost all of the read-side checking of metaecc. xattr buckets are not checked
yet. Writes are also unchecked, and so a read-write mount will quickly fail.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/blockcheck.c')
-rw-r--r-- | fs/ocfs2/blockcheck.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ocfs2/blockcheck.c b/fs/ocfs2/blockcheck.c index 2bf3d7f61aec..2ce6ae5e4b8c 100644 --- a/fs/ocfs2/blockcheck.c +++ b/fs/ocfs2/blockcheck.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
25 | #include <asm/byteorder.h> | 25 | #include <asm/byteorder.h> |
26 | 26 | ||
27 | #include <cluster/masklog.h> | ||
28 | |||
27 | #include "ocfs2.h" | 29 | #include "ocfs2.h" |
28 | 30 | ||
29 | #include "blockcheck.h" | 31 | #include "blockcheck.h" |
@@ -292,6 +294,10 @@ int ocfs2_block_check_validate(void *data, size_t blocksize, | |||
292 | if (crc == check.bc_crc32e) | 294 | if (crc == check.bc_crc32e) |
293 | goto out; | 295 | goto out; |
294 | 296 | ||
297 | mlog(ML_ERROR, | ||
298 | "CRC32 failed: stored: %u, computed %u. Applying ECC.\n", | ||
299 | (unsigned int)check.bc_crc32e, (unsigned int)crc); | ||
300 | |||
295 | /* Ok, try ECC fixups */ | 301 | /* Ok, try ECC fixups */ |
296 | ecc = ocfs2_hamming_encode_block(data, blocksize); | 302 | ecc = ocfs2_hamming_encode_block(data, blocksize); |
297 | ocfs2_hamming_fix_block(data, blocksize, ecc ^ check.bc_ecc); | 303 | ocfs2_hamming_fix_block(data, blocksize, ecc ^ check.bc_ecc); |
@@ -301,6 +307,9 @@ int ocfs2_block_check_validate(void *data, size_t blocksize, | |||
301 | if (crc == check.bc_crc32e) | 307 | if (crc == check.bc_crc32e) |
302 | goto out; | 308 | goto out; |
303 | 309 | ||
310 | mlog(ML_ERROR, "Fixed CRC32 failed: stored: %u, computed %u\n", | ||
311 | (unsigned int)check.bc_crc32e, (unsigned int)crc); | ||
312 | |||
304 | rc = -EIO; | 313 | rc = -EIO; |
305 | 314 | ||
306 | out: | 315 | out: |