From: Christoph Hellwig <hch@infradead.org>
To: Zheng Bin <zhengbin13@huawei.com>
Cc: sandeen@sandeen.net, bfoster@redhat.com, dchinner@redhat.com,
darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
renxudong1@huawei.com, yi.zhang@huawei.com
Subject: Re: [PATCH v2] xfs: add agf freeblocks verify in xfs_agf_verify
Date: Thu, 20 Feb 2020 07:40:34 -0800 [thread overview]
Message-ID: <20200220154034.GA6870@infradead.org> (raw)
In-Reply-To: <1582197182-142137-1-git-send-email-zhengbin13@huawei.com>
On Thu, Feb 20, 2020 at 07:13:02PM +0800, Zheng Bin wrote:
> + if (be32_to_cpu(agf->agf_length) > mp->m_sb.sb_dblocks ||
> + be32_to_cpu(agf->agf_btreeblks) > be32_to_cpu(agf->agf_length) ||
> + be32_to_cpu(agf->agf_rmap_blocks) > be32_to_cpu(agf->agf_length) ||
> + be32_to_cpu(agf->agf_refcount_blocks) > be32_to_cpu(agf->agf_length) ||
This adds a > 80 char line, please properly format it.
> + be32_to_cpu(agf->agf_spare2) != 0)
> + return __this_address;
There is no need to byte swap fields if you just check if they are
non-zero.
> +
> + for (i = 0; i < ARRAY_SIZE(agf->agf_spare64); i++)
> + if (be64_to_cpu(agf->agf_spare64[i]) != 0)
> + return __this_address;
Same here.
next prev parent reply other threads:[~2020-02-20 15:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 11:13 [PATCH v2] xfs: add agf freeblocks verify in xfs_agf_verify Zheng Bin
2020-02-20 15:40 ` Christoph Hellwig [this message]
2020-02-20 15:56 ` Darrick J. Wong
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=20200220154034.GA6870@infradead.org \
--to=hch@infradead.org \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=renxudong1@huawei.com \
--cc=sandeen@sandeen.net \
--cc=yi.zhang@huawei.com \
--cc=zhengbin13@huawei.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