···22992299 e = allocatesize_fsb;23002300 }2301230123022302+ /*23032303+ * The transaction reservation is limited to a 32-bit block23042304+ * count, hence we need to limit the number of blocks we are23052305+ * trying to reserve to avoid an overflow. We can't allocate23062306+ * more than @nimaps extents, and an extent is limited on disk23072307+ * to MAXEXTLEN (21 bits), so use that to enforce the limit.23082308+ */23092309+ resblks = min_t(xfs_fileoff_t, (e - s), (MAXEXTLEN * nimaps));23022310 if (unlikely(rt)) {23032303- resrtextents = qblocks = (uint)(e - s);23112311+ resrtextents = qblocks = resblks;23042312 resrtextents /= mp->m_sb.sb_rextsize;23052313 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);23062314 quota_flag = XFS_QMOPT_RES_RTBLKS;23072315 } else {23082316 resrtextents = 0;23092309- resblks = qblocks = \23102310- XFS_DIOSTRAT_SPACE_RES(mp, (uint)(e - s));23172317+ resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, resblks);23112318 quota_flag = XFS_QMOPT_RES_REGBLKS;23122319 }23132320