> - while (xfs_btree_islastblock(acur.cnt, 0)) { > + error = xfs_btree_islastblock(acur.cnt, 0, &is_last); > + if (error) > + goto out; > + while (is_last) { This transformation looks actually ok, but is highly non-obvious. I think you want a prep patch just killing the pointless while first.