public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bill O'Donnell" <billodo@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Anatoly Pugachev <matorola@gmail.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_db: fix unaligned accesses
Date: Fri, 6 May 2016 16:38:18 -0500	[thread overview]
Message-ID: <20160506213818.GA18803@redhat.com> (raw)
In-Reply-To: <a8a63bc2-86ac-4f30-9b5d-79edf94cad57@redhat.com>

On Fri, May 06, 2016 at 03:43:53PM -0500, Eric Sandeen wrote:
> Fix 2 unaligned accesses in xfs_db which caused bus errors on
> sparc64.  Similar treatment was already done in xfs_repair and
> xfs_metadump but somehow xfs_db got missed.
> 
> Thanks to Anatoly for reminding me that unaligned access is
> a thing.  ;)
> 
> Resolves-oss-bugzilla: #1140
> Reported-by: Anatoly Pugachev <matorola@gmail.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> 
> diff --git a/db/check.c b/db/check.c
> index c626a5c..0871ed7 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -2202,7 +2202,7 @@ process_btinode(
>  		pp = XFS_BMDR_PTR_ADDR(dib, 1, xfs_bmdr_maxrecs(
>  				XFS_DFORK_SIZE(dip, mp, whichfork), 0));
>  		for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
> -			scan_lbtree(be64_to_cpu(pp[i]),
> +			scan_lbtree(get_unaligned_be64(&pp[i]),
>  					be16_to_cpu(dib->bb_level),
>  					scanfunc_bmap, type, id, totd, toti,
>  					nex, blkmapp, 1,
> diff --git a/db/frag.c b/db/frag.c
> index 3beb416..36bb689 100644
> --- a/db/frag.c
> +++ b/db/frag.c
> @@ -258,8 +258,8 @@ process_btinode(
>  	pp = XFS_BMDR_PTR_ADDR(dib, 1,
>  		xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0));
>  	for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
> -		scan_lbtree(be64_to_cpu(pp[i]), be16_to_cpu(dib->bb_level),
> -			scanfunc_bmap, extmapp,
> +		scan_lbtree(get_unaligned_be64(&pp[i]),
> +			 be16_to_cpu(dib->bb_level), scanfunc_bmap, extmapp,
>  			whichfork == XFS_DATA_FORK ? TYP_BMAPBTD : TYP_BMAPBTA);
>  }
>  
> 
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2016-05-06 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 20:43 [PATCH] xfs_db: fix unaligned accesses Eric Sandeen
2016-05-06 21:38 ` Bill O'Donnell [this message]

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=20160506213818.GA18803@redhat.com \
    --to=billodo@redhat.com \
    --cc=matorola@gmail.com \
    --cc=sandeen@redhat.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