From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 01/10] xfs: change xfs_attr3_rmt_hdr_ok to return bool
Date: Mon, 17 Dec 2018 10:23:57 -0800 [thread overview]
Message-ID: <20181217182357.GD7823@magnolia> (raw)
In-Reply-To: <1b1b2992-5304-e9e2-b20e-ac41235744f7@redhat.com>
On Wed, Dec 05, 2018 at 03:02:15PM -0600, Eric Sandeen wrote:
> xfs_attr3_rmt_hdr_ok is only checked for true/false and the caller
> does nothing with the returned failaddr, so make it a bool.
> (its usage and naming lend itself to a bool too, i.e. test (!ok))
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> fs/xfs/libxfs/xfs_attr_remote.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
> index d89363c6b523..f86680e08613 100644
> --- a/fs/xfs/libxfs/xfs_attr_remote.c
> +++ b/fs/xfs/libxfs/xfs_attr_remote.c
> @@ -53,7 +53,7 @@ xfs_attr3_rmt_blocks(
> * does CRC, location and bounds checking, the unpacking function checks the
> * attribute parameters and owner.
> */
> -static xfs_failaddr_t
> +static bool
> xfs_attr3_rmt_hdr_ok(
> void *ptr,
> xfs_ino_t ino,
> @@ -64,16 +64,16 @@ xfs_attr3_rmt_hdr_ok(
> struct xfs_attr3_rmt_hdr *rmt = ptr;
>
> if (bno != be64_to_cpu(rmt->rm_blkno))
> - return __this_address;
> + return false;
> if (offset != be32_to_cpu(rmt->rm_offset))
> - return __this_address;
> + return false;
> if (size != be32_to_cpu(rmt->rm_bytes))
> - return __this_address;
> + return false;
> if (ino != be64_to_cpu(rmt->rm_owner))
> - return __this_address;
> + return false;
>
> /* ok */
> - return NULL;
> + return true;
> }
>
> static xfs_failaddr_t
> @@ -287,7 +287,7 @@ xfs_attr_rmtval_copyout(
> byte_cnt = min(*valuelen, byte_cnt);
>
> if (xfs_sb_version_hascrc(&mp->m_sb)) {
> - if (xfs_attr3_rmt_hdr_ok(src, ino, *offset,
> + if (!xfs_attr3_rmt_hdr_ok(src, ino, *offset,
Why not pass a verifier context to attr3_rmt_hdr_ok and enable
rmtval_copyout to report the approximate instruction address of the
failed check?
(Or maybe I missed you doing this later...?)
--D
> byte_cnt, bno)) {
> xfs_alert(mp,
> "remote attribute header mismatch bno/off/len/owner (0x%llx/0x%x/Ox%x/0x%llx)",
> --
> 2.17.0
>
>
next prev parent reply other threads:[~2018-12-17 18:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 21:01 [PATCH RFC 0/10] xfs: add verifier context structure Eric Sandeen
2018-12-05 21:02 ` [PATCH 01/10] xfs: change xfs_attr3_rmt_hdr_ok to return bool Eric Sandeen
2018-12-07 13:36 ` Brian Foster
2018-12-17 18:23 ` Darrick J. Wong [this message]
2018-12-05 21:03 ` [PATCH 02/10] xfs: make checksum verifiers consistently return bools Eric Sandeen
2018-12-07 13:36 ` Brian Foster
2018-12-17 18:24 ` Darrick J. Wong
2018-12-05 21:03 ` [PATCH 03/10] xfs: pass a verifier context down verifier callchains Eric Sandeen
2018-12-17 18:29 ` Darrick J. Wong
2018-12-05 21:04 ` [PATCH 04/10] xfs: pass a verifier context to crc validation functions Eric Sandeen
2018-12-05 21:05 ` [PATCH 05/10] xfs: define new macros to set verifier context on return Eric Sandeen
2018-12-05 21:06 ` [PATCH 06/10] xfs: teach xfs_btree_[sl]block_verify_crc to populate verifier context Eric Sandeen
2018-12-05 21:08 ` [PATCH 07/10] xfs: change all verifiers to return booleans Eric Sandeen
2018-12-05 21:09 ` [PATCH 08/10] xfs: set failaddr into vc for checksum failures Eric Sandeen
2018-12-07 13:37 ` Brian Foster
2018-12-10 16:00 ` Eric Sandeen
2018-12-17 18:39 ` Darrick J. Wong
2018-12-05 21:11 ` [PATCH 09/10] xfs: add errno to verifier context and populate it Eric Sandeen
2018-12-07 13:41 ` Brian Foster
2018-12-05 21:11 ` [PATCH 10/10] xfs: condense crc and verifier checks where possible Eric Sandeen
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=20181217182357.GD7823@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.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 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.