On Mon, Sep 11, 2017 at 11:49:25AM -0400, Brian Foster wrote: > > + if (!xfs_iext_get_extent(ifp, ++idx, &got)) { > > + xfs_fileoff_t end = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); > > + > > + out[bmv->bmv_entries].bmv_oflags |= BMV_OF_LAST; > > + > > I'm a little confused about the above bit. Isn't ->bmv_entries already > incremented past the last reported extent? Yes, it needs to be bmv->bmv_entries - 1. > Further, if there is a hole > to be reported, we potentially do that just below (which means that > ->bmv_entries may or may not refer to the last reported segment here)..? We can't reach this code when the previous extent was a hole. For the whole file hole case we jump straight to out_unlock_ilock after filling the hole, for the inbetween extents hole case we break out of the loop when running out of space before filling the second extent, and the end of file hole case is just below setting BMV_OF_LAST. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html