All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: use a local variable for magic number in xfs_da3_node_lookup_int
Date: Wed, 1 Aug 2018 08:07:51 -0400	[thread overview]
Message-ID: <20180801120750.GC48176@bfoster> (raw)
In-Reply-To: <153307925470.7924.18204385078598751297.stgit@magnolia>

On Tue, Jul 31, 2018 at 04:20:54PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use a local variable for the block magic number checks instead of
> abusing blk->magic.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_da_btree.c |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
> index 9efbd2038ffb..8ffe17b223da 100644
> --- a/fs/xfs/libxfs/xfs_da_btree.c
> +++ b/fs/xfs/libxfs/xfs_da_btree.c
> @@ -1481,6 +1481,7 @@ xfs_da3_node_lookup_int(
>  	int			error;
>  	int			retval;
>  	unsigned int		expected_level = 0;
> +	uint16_t		magic;
>  	struct xfs_inode	*dp = state->args->dp;
>  
>  	args = state->args;
> @@ -1505,17 +1506,17 @@ xfs_da3_node_lookup_int(
>  			return error;
>  		}
>  		curr = blk->bp->b_addr;
> -		blk->magic = be16_to_cpu(curr->magic);
> +		magic = be16_to_cpu(curr->magic);
>  
> -		if (blk->magic == XFS_ATTR_LEAF_MAGIC ||
> -		    blk->magic == XFS_ATTR3_LEAF_MAGIC) {
> +		if (magic == XFS_ATTR_LEAF_MAGIC ||
> +		    magic == XFS_ATTR3_LEAF_MAGIC) {
>  			blk->magic = XFS_ATTR_LEAF_MAGIC;
>  			blk->hashval = xfs_attr_leaf_lasthash(blk->bp, NULL);
>  			break;
>  		}
>  
> -		if (blk->magic == XFS_DIR2_LEAFN_MAGIC ||
> -		    blk->magic == XFS_DIR3_LEAFN_MAGIC) {
> +		if (magic == XFS_DIR2_LEAFN_MAGIC ||
> +		    magic == XFS_DIR3_LEAFN_MAGIC) {
>  			blk->magic = XFS_DIR2_LEAFN_MAGIC;
>  			blk->hashval = xfs_dir2_leaf_lasthash(args->dp,
>  							      blk->bp, NULL);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-08-01 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 23:20 [PATCH 1/2] xfs: use a local variable for magic number in xfs_da3_node_lookup_int Darrick J. Wong
2018-07-31 23:21 ` [PATCH 2/2] xfs: check da node magic in _node_lookup_int Darrick J. Wong
2018-08-01 12:07   ` Brian Foster
2018-08-01 12:12   ` Carlos Maiolino
2018-08-01 14:15     ` Darrick J. Wong
2018-08-02  9:38       ` Carlos Maiolino
2018-08-01 12:07 ` Brian Foster [this message]
2018-08-01 12:10 ` [PATCH 1/2] xfs: use a local variable for magic number in xfs_da3_node_lookup_int Carlos Maiolino
  -- strict thread matches above, loose matches on Subject: below --
2018-07-31 23:20 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=20180801120750.GC48176@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@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.