On Mon, Sep 30, 2019 at 12:58:54AM -0700, Christoph Hellwig wrote: > On Fri, Sep 27, 2019 at 07:41:02AM +1000, Dave Chinner wrote: > > > +static int iext_maxrecs(struct xfs_mount *mp, int blocklen, int leaf) > > > +{ > > > + blocklen -= 2 * sizeof(void *); > > > + > > > + return blocklen / sizeof(struct xfs_bmbt_rec); > > > +} > > > > This isn't correct for the iext nodes. They hold 16 key/ptr pairs, > > not 15. > > > > I suspect you should be lifting the iext btree format definitions > > like this one: > > Is the command supposed to deal with the on-disk or in-memory nodes? > The ones your quote are the in-memory btrees, but the file seems > (the way I read it, the documentation seems to be lacking) with the > on-disk btrees. It started as a command for calculating ondisk btree geometry but then we were discussing the iext tree geometry on irc so I extended it to handle that too. (Ugh, where /did/ the documentation go...) --D