|
@@ -1493,12 +1493,25 @@ xfs_bmbt_split(
|
|
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
|
|
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
|
|
args.fsbno = cur->bc_private.b.firstblock;
|
|
args.fsbno = cur->bc_private.b.firstblock;
|
|
args.firstblock = args.fsbno;
|
|
args.firstblock = args.fsbno;
|
|
|
|
+ args.minleft = 0;
|
|
if (args.fsbno == NULLFSBLOCK) {
|
|
if (args.fsbno == NULLFSBLOCK) {
|
|
args.fsbno = lbno;
|
|
args.fsbno = lbno;
|
|
args.type = XFS_ALLOCTYPE_START_BNO;
|
|
args.type = XFS_ALLOCTYPE_START_BNO;
|
|
|
|
+ /*
|
|
|
|
+ * Make sure there is sufficient room left in the AG to
|
|
|
|
+ * complete a full tree split for an extent insert. If
|
|
|
|
+ * we are converting the middle part of an extent then
|
|
|
|
+ * we may need space for two tree splits.
|
|
|
|
+ *
|
|
|
|
+ * We are relying on the caller to make the correct block
|
|
|
|
+ * reservation for this operation to succeed. If the
|
|
|
|
+ * reservation amount is insufficient then we may fail a
|
|
|
|
+ * block allocation here and corrupt the filesystem.
|
|
|
|
+ */
|
|
|
|
+ args.minleft = xfs_trans_get_block_res(args.tp);
|
|
} else
|
|
} else
|
|
args.type = XFS_ALLOCTYPE_NEAR_BNO;
|
|
args.type = XFS_ALLOCTYPE_NEAR_BNO;
|
|
- args.mod = args.minleft = args.alignment = args.total = args.isfl =
|
|
|
|
|
|
+ args.mod = args.alignment = args.total = args.isfl =
|
|
args.userdata = args.minalignslop = 0;
|
|
args.userdata = args.minalignslop = 0;
|
|
args.minlen = args.maxlen = args.prod = 1;
|
|
args.minlen = args.maxlen = args.prod = 1;
|
|
args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
|
|
args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
|