From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: check magic numbers in dir3 leaf verifier first
Date: Tue, 3 Sep 2013 00:33:12 -0700 [thread overview]
Message-ID: <20130903073312.GA1422@infradead.org> (raw)
In-Reply-To: <20130903000658.GJ12779@dastard>
> @@ -165,6 +165,7 @@ xfs_dir3_leaf_check_int(
> (char *)&ents[hdr->count] > (char *)xfs_dir2_leaf_bests_p(ltp))
> return false;
>
> +
> /* Check hash value order, count stale entries. */
spurious new line..
> if (xfs_sb_version_hascrc(&mp->m_sb)) {
> struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
> + __uint16_t magic3;
>
> + magic3 = (magic == XFS_DIR2_LEAF1_MAGIC) ? XFS_DIR3_LEAF1_MAGIC
> + : XFS_DIR3_LEAFN_MAGIC;
>
> + if (leaf3->info.hdr.magic != cpu_to_be16(magic3))
> + return false;
> if (!uuid_equal(&leaf3->info.uuid, &mp->m_sb.sb_uuid))
> return false;
> if (be64_to_cpu(leaf3->info.blkno) != bp->b_bn)
> return false;
> } else {
> - if (leafhdr.magic != magic)
> + if (leaf->hdr.info.magic != cpu_to_be16(magic))
> return false;
> }
Looks good but I wonder if something like this should be factored into
a separate helper in the long run.
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-09-03 7:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 10:50 [PATCH] xfs: check magic numbers in dir3 leaf verifier first Dave Chinner
2013-09-03 0:06 ` [PATCH v2] " Dave Chinner
2013-09-03 7:33 ` Christoph Hellwig [this message]
2013-09-09 22:51 ` Ben Myers
2013-10-18 16:48 ` Rich Johnston
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=20130903073312.GA1422@infradead.org \
--to=hch@infradead.org \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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