提交 fe5ed6c2 编写于 作者: P Pan Bian 提交者: Darrick J. Wong

xfs: libxfs: move xfs_perag_put late

The function xfs_alloc_get_freelist calls xfs_perag_put to drop the
reference. However, pag->pagf_btreeblks is read and written after the
put operation. This patch moves the put operation later.
Signed-off-by: NPan Bian <bianpan2016@163.com>
Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
[darrick: minor changelog edits]
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 d6f215f3
...@@ -2435,7 +2435,6 @@ xfs_alloc_get_freelist( ...@@ -2435,7 +2435,6 @@ xfs_alloc_get_freelist(
be32_add_cpu(&agf->agf_flcount, -1); be32_add_cpu(&agf->agf_flcount, -1);
xfs_trans_agflist_delta(tp, -1); xfs_trans_agflist_delta(tp, -1);
pag->pagf_flcount--; pag->pagf_flcount--;
xfs_perag_put(pag);
logflags = XFS_AGF_FLFIRST | XFS_AGF_FLCOUNT; logflags = XFS_AGF_FLFIRST | XFS_AGF_FLCOUNT;
if (btreeblk) { if (btreeblk) {
...@@ -2443,6 +2442,7 @@ xfs_alloc_get_freelist( ...@@ -2443,6 +2442,7 @@ xfs_alloc_get_freelist(
pag->pagf_btreeblks++; pag->pagf_btreeblks++;
logflags |= XFS_AGF_BTREEBLKS; logflags |= XFS_AGF_BTREEBLKS;
} }
xfs_perag_put(pag);
xfs_alloc_log_agf(tp, agbp, logflags); xfs_alloc_log_agf(tp, agbp, logflags);
*bnop = bno; *bnop = bno;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册