Unverified Commit 81c17fd3 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents c6f2acea bd0d05a6
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -543,6 +543,13 @@ xfs_alloc_fixup_trees(
		nfbno2 = rbno + rlen;
		nflen2 = (fbno + flen) - nfbno2;
	}

	/*
	 * Record the potential maximum free length in advance.
	 */
	if (nfbno1 != NULLAGBLOCK || nfbno2 != NULLAGBLOCK)
		cnt_cur->bc_free_longest = max_t(xfs_extlen_t, nflen1, nflen2);

	/*
	 * Delete the entry from the by-size btree.
	 */
@@ -2039,6 +2046,13 @@ xfs_free_ag_extent(
	 * Now allocate and initialize a cursor for the by-size tree.
	 */
	cnt_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT);
	/*
	 * Record the potential maximum free length in advance.
	 */
	if (haveleft)
		cnt_cur->bc_free_longest = ltlen;
	if (haveright)
		cnt_cur->bc_free_longest = gtlen;
	/*
	 * Have both left and right contiguous neighbors.
	 * Merge all three into a single free block.
+8 −1
Original line number Diff line number Diff line
@@ -147,7 +147,14 @@ xfs_allocbt_update_lastrec(
			rrp = XFS_ALLOC_REC_ADDR(cur->bc_mp, block, numrecs);
			len = rrp->ar_blockcount;
		} else {
			len = 0;
			/*
			 * Update in advance to prevent file creation failure
			 * for concurrent processes even though there is no
			 * numrec currently.
			 * And there's no need to worry as the value that not
			 * less than bc_free_longest will be inserted later.
			 */
			len = cpu_to_be32(cur->bc_free_longest);
		}

		break;
+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ typedef struct xfs_btree_cur
		struct xfs_btree_cur_ag	bc_ag;
		struct xfs_btree_cur_ino bc_ino;
	};
	xfs_extlen_t	bc_free_longest;	/* the actual longest free extent */
} xfs_btree_cur_t;

/* cursor flags */