Re: [PATCH 2/5] xfs_repair: fix unaligned accesses

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

 



On Fri, Oct 09, 2015 at 04:08:22PM -0400, Brian Foster wrote:
> On Fri, Oct 09, 2015 at 02:51:09PM -0500, Eric Sandeen wrote:
> > This fixes some unaligned accesses spotted by libubsan in repair.
> > 
> > See Documentation/unaligned-memory-access.txt in the kernel
> > tree for why these can be a problem.
> > 
> > Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> > ---
> 
> Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>
....
> > @@ -960,15 +960,17 @@ _("bad numrecs 0 in inode %" PRIu64 " bmap btree root block\n"),
> >  		 * btree, we'd do it right here.  For now, if there's a
> >  		 * problem, we'll bail out and presumably clear the inode.
> >  		 */
> > -		if (!verify_dfsbno(mp, be64_to_cpu(pp[i])))  {
> > -			do_warn(_("bad bmap btree ptr 0x%llx in ino %" PRIu64 "\n"),
> > -			       (unsigned long long) be64_to_cpu(pp[i]), lino);
> > +		if (!verify_dfsbno(mp, get_unaligned_be64(&pp[i])))  {
> > +			do_warn(
> > +("bad bmap btree ptr 0x%" PRIx64 " in ino %" PRIu64 "\n"),
> > +				get_unaligned_be64(&pp[i]), lino);

drops the "_" from the translation string. I'll fix it on commit.

/me can't help but think that a local variable or two would make
this code so much more readable....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux