> - *current_ext < XFS_IFORK_NEXTENTS(ip, whichfork)) { > + /* > + * There may be delalloc extents in the data fork before the range we > + * are collapsing out, so we cannot > + * use the count of real extents here. Instead we have to calculate it > + * from the incore fork. > + */ > + total_extents = ifp->if_bytes / sizeof(xfs_bmbt_rec_t); Between the amount of times we have this calculation opencoded, and the confusing nature of XFS_IFORK_NEXTENTS it might be time to introduce a macro to get the proper number of incore extents. But no need to do this now, so: Reviewed-by: Christoph Hellwig <hch@xxxxxx> _______________________________________________ xfs mailing list xfs@xxxxxxxxxxx http://oss.sgi.com/mailman/listinfo/xfs