[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [sparc64] mkfs.btrfs bus error / align issue?



On Thu, Jul 28, 2016 at 04:28:41PM +0200, John Paul Adrian Glaubitz wrote:
> On 07/28/2016 04:25 PM, John Paul Adrian Glaubitz wrote:
> > On 07/28/2016 04:01 PM, Anatoly Pugachev wrote:
> >> Program received signal SIGBUS, Bus error.
> >> 0x0000000000177dfc in raid6_gen_syndrome (disks=4, bytes=65536,
> >> ptrs=0x2c4510) at raid6.c:87
> >> 87                      wq0 = wp0 = *(unative_t *)&dptr[z0][d+0*NSIZE];
> > 
> > That should be easy to fix. Just make the R values aligned with the
> > appropriate get_aligned functions, see David's previous commit [1]:
> 
> Argh, those are called get_UNaligned_*, not get_aligned_*.
> 
> > There are more lines in raid6.c which need the same fix, basically everything
> > with * (unative_t *).
> 
> Oh, and you will somehow need to guard this with #if BITS_PER_LONG == 64 ...
> #else ... #endif respectively since you need to use different versions
> (64 vs. 32) of get_unaligned_* depending on the size of unative_t.

And I've fixed it that way, now pushed to devel ("btrfs-progs: fix
unaligned access in raid6 calculations" [1]). Would be great if you or
Anatoly can test it so I can add it to the 4.7 release (ETA tomorrow).

[1] https://github.com/kdave/btrfs-progs/commit/44b35e94facf820d2c2d8e1be631bf40d68dff8d


Reply to: