public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Alexander Beregalov <a.beregalov@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix unaligned access at btrfs_csum_final()
Date: Tue, 23 Mar 2010 20:51:55 -0400	[thread overview]
Message-ID: <20100324005155.GE5021@think> (raw)
In-Reply-To: <20100323153420.GC30249@think>

On Tue, Mar 23, 2010 at 11:34:20AM -0400, Chris Mason wrote:
> On Mon, Mar 22, 2010 at 02:31:08AM +0300, Alexander Beregalov wrote:
> > Btrfs on Sparc64 produces a lot of warnings
> > Kernel unaligned access at TPC[10148c84] btrfs_csum_final+0x44/0x60 [btrfs]
> 
> Great, thanks for trackign this down.
> 
> > 
> > It happens when btrfs_csum_final is called from write_dev_supers():
> > 2195:	btrfs_csum_final(crc, sb->csum);
> > 
> > crc is u32, aligning sb->csum on 4-byte boundary fixes the problem.
> 
> So the size of the csum field is already 4 byte aligned, I'm surprised
> we need this?

Jens did some testing and this patch changes the size of the super
struct, which changes things on disk.

But, the real problem is write_dev_supers operates on a copy of the
super struct and that copy isn't aligned.  So we just need to align the
copy in struct btrfs_fs_info, which Jens should have a neat little patch
for shortly.

So we should finally have this one fixed up shortly.  Thanks again.

-chris


      reply	other threads:[~2010-03-24  0:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-21 23:31 [PATCH] Btrfs: fix unaligned access at btrfs_csum_final() Alexander Beregalov
2010-03-23 15:34 ` Chris Mason
2010-03-24  0:51   ` Chris Mason [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=20100324005155.GE5021@think \
    --to=chris.mason@oracle.com \
    --cc=a.beregalov@gmail.com \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox