From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error
Date: Thu, 12 Aug 2010 16:24:26 -0700 [thread overview]
Message-ID: <1281655466-26341-2-git-send-email-sunil.mushran@oracle.com> (raw)
In-Reply-To: <1281655466-26341-1-git-send-email-sunil.mushran@oracle.com>
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
next prev parent reply other threads:[~2010-08-12 23:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 23:24 [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Sunil Mushran
2010-08-12 23:24 ` Sunil Mushran [this message]
2010-08-13 23:31 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Fix incorrect checksum validation error Mark Fasheh
2010-08-13 23:28 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Fix metaecc error messages Mark Fasheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281655466-26341-2-git-send-email-sunil.mushran@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).