Hi Dave. I've been playing a bit with it, and, based on our talk on IRC: > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -4286,6 +4286,20 @@ xfs_bmapi_write( > #endif > whichfork = xfs_bmapi_whichfork(flags); > > + /* > + * XXX: Hack! > + * > + * If the total blocks requested is larger than an AG, we can't allocate > + * all the space atomically and within a single AG. This will be a > + * "short" allocation. In this case, just ignore the total block count > + * and rely on minleft calculations to ensure the allocation we do fits > + * inside an AG properly. > + * > + * Based on a patch from Brian. > + */ > + if (bma.total > mp->m_ag_max_usable) > + bma.total = 0; Instead zeroing bma.total here, can't we crop it to blen in xfs_bmap_btalloc()? I did some tests here and looks like the result is the same, although I'm not sure if it's a good approach. Cheers > + > ASSERT(*nmap >= 1); > ASSERT(*nmap <= XFS_BMAP_MAX_NMAP); > ASSERT(tp != NULL); -- Carlos