* [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages
@ 2010-08-12 23:24 Sunil Mushran
2010-08-12 23:24 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error Sunil Mushran
2010-08-13 23:28 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Mark Fasheh
0 siblings, 2 replies; 4+ messages in thread
From: Sunil Mushran @ 2010-08-12 23:24 UTC (permalink / raw)
To: ocfs2-devel
Like tools, the checksum validate function now prints the values in hex.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
---
fs/ocfs2/blockcheck.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/blockcheck.c b/fs/ocfs2/blockcheck.c
index ec6d123..c7ee03c 100644
--- a/fs/ocfs2/blockcheck.c
+++ b/fs/ocfs2/blockcheck.c
@@ -439,7 +439,7 @@ int ocfs2_block_check_validate(void *data, size_t blocksize,
ocfs2_blockcheck_inc_failure(stats);
mlog(ML_ERROR,
- "CRC32 failed: stored: %u, computed %u. Applying ECC.\n",
+ "CRC32 failed: stored: 0x%x, computed 0x%x. Applying ECC.\n",
(unsigned int)check.bc_crc32e, (unsigned int)crc);
/* Ok, try ECC fixups */
@@ -453,7 +453,7 @@ int ocfs2_block_check_validate(void *data, size_t blocksize,
goto out;
}
- mlog(ML_ERROR, "Fixed CRC32 failed: stored: %u, computed %u\n",
+ mlog(ML_ERROR, "Fixed CRC32 failed: stored: 0x%x, computed 0x%x\n",
(unsigned int)check.bc_crc32e, (unsigned int)crc);
rc = -EIO;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error
2010-08-12 23:24 [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Sunil Mushran
@ 2010-08-12 23:24 ` Sunil Mushran
2010-08-13 23:31 ` Mark Fasheh
2010-08-13 23:28 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Mark Fasheh
1 sibling, 1 reply; 4+ messages in thread
From: Sunil Mushran @ 2010-08-12 23:24 UTC (permalink / raw)
To: ocfs2-devel
For local mounts, ocfs2_read_locked_inode() calls ocfs2_read_blocks_sync() to
read the inode off the disk. The latter first checks to see if that block is
cached in the journal, and, if so, returns that block. That is ok.
But ocfs2_read_locked_inode() goes wrong when it tries to validate the checksum
of such blocks. Blocks that are cached in the journal may not have had their
checksum computed as yet. We should not validate the checksums of such blocks.
Fixes ossbz#1282
http://oss.oracle.com/bugzilla/show_bug.cgi?id=1282
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
---
fs/ocfs2/inode.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index abb0a95..c9fcce3 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -488,7 +488,11 @@ static int ocfs2_read_locked_inode(struct inode *inode,
OCFS2_BH_IGNORE_CACHE);
} else {
status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
- if (!status)
+ /*
+ * If buffer is in jbd, then its checksum may not have been
+ * computed as yet.
+ */
+ if (!status && (!buffer_jbd(bh)))
status = ocfs2_validate_inode_block(osb->sb, bh);
}
if (status < 0) {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages
2010-08-12 23:24 [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Sunil Mushran
2010-08-12 23:24 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error Sunil Mushran
@ 2010-08-13 23:28 ` Mark Fasheh
1 sibling, 0 replies; 4+ messages in thread
From: Mark Fasheh @ 2010-08-13 23:28 UTC (permalink / raw)
To: ocfs2-devel
On Thu, Aug 12, 2010 at 04:24:25PM -0700, Sunil Mushran wrote:
> Like tools, the checksum validate function now prints the values in hex.
>
> Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Acked-by: Mark Fasheh <mfasheh@suse.com>
And thanks, this was rather annoying when I was last comparing checksums
between different parts of the code / project.
--Mark
--
Mark Fasheh
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error
2010-08-12 23:24 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error Sunil Mushran
@ 2010-08-13 23:31 ` Mark Fasheh
0 siblings, 0 replies; 4+ messages in thread
From: Mark Fasheh @ 2010-08-13 23:31 UTC (permalink / raw)
To: ocfs2-devel
On Thu, Aug 12, 2010 at 04:24:26PM -0700, Sunil Mushran wrote:
> For local mounts, ocfs2_read_locked_inode() calls ocfs2_read_blocks_sync() to
> read the inode off the disk. The latter first checks to see if that block is
> cached in the journal, and, if so, returns that block. That is ok.
>
> But ocfs2_read_locked_inode() goes wrong when it tries to validate the checksum
> of such blocks. Blocks that are cached in the journal may not have had their
> checksum computed as yet. We should not validate the checksums of such blocks.
>
> Fixes ossbz#1282
> http://oss.oracle.com/bugzilla/show_bug.cgi?id=1282
>
> Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Good catch.
Acked-by: Mark Fasheh <mfasheh@suse.com>
--Mark
--
Mark Fasheh
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-13 23:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12 23:24 [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Sunil Mushran
2010-08-12 23:24 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error Sunil Mushran
2010-08-13 23:31 ` Mark Fasheh
2010-08-13 23:28 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Mark Fasheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).