Re: [PATCH 1/4] xfs: detect self referencing btree sibling pointers

Dave Chinner
2022-05-03T21:27:38Z

On Tue, May 03, 2022 at 07:53:45AM -0700, Christoph Hellwig wrote:
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> One nit (with a few instances):
>
> > + if (level >= 0) {
> > + if (!xfs_btree_check_lptr(cur, sibling, level + 1))
> > + return __this_address;
> > + } else if (!xfs_verify_fsbno(mp, sibling)) {
> > + return __this_address;
> > + }
>
> Maybe it's just me, but I would find the non-condensed version a little
> easier to read for these kinds of checks:
>
> if (level >= 0) {
> if (!xfs_btree_check_lptr(cur, sibling, level + 1))
> return __this_address;
> } else {
> if (!xfs_verify_fsbno(mp, sibling))
> return __this_address;
> }

Ok, I can do that.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com