From: TARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: Redundant check in verify_parent_transid
Date: Tue, 30 Jun 2009 14:24:21 +0900 [thread overview]
Message-ID: <4A49A185.5080109@jp.fujitsu.com> (raw)
Hi,
In verify_parent_transid() of disk-io.c (btrfs-progs), I found
redundant check.
---
static int verify_parent_transid(struct extent_io_tree *io_tree,
struct extent_buffer *eb, u64 parent_transid)
{
int ret;
if (!parent_transid || btrfs_header_generation(eb) == parent_transid)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
If second check is true in this sentense, then the function return.
So the next if sentence is not estimated.
---
return 0;
if (extent_buffer_uptodate(eb) &&
btrfs_header_generation(eb) == parent_transid) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ret = 0;
goto out;
}
---
However, here has same check which looks redundant.
I guess here includes a bug, but I'm not sure.
Could someone tell me why?
---
printk("parent transid verify failed on %llu wanted %llu found %llu\n",
(unsigned long long)eb->start,
(unsigned long long)parent_transid,
(unsigned long long)btrfs_header_generation(eb));
ret = 1;
---(snip)---
--
taruisi
reply other threads:[~2009-06-30 5:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4A49A185.5080109@jp.fujitsu.com \
--to=taruishi.hiroak@jp.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.