mirror of https://gitee.com/openkylin/linux.git
xfs: destroy mutex pag_ici_reclaim_lock before free
The mutex pag_ici_reclaim_lock of xfs_perag_t structure is initialized in xfs_initialize_perag. If happen errors in xfs_initialize_perag, or free resources in xfs_free_perag, wo need to destroy the mutex before free perag. Signed-off-by: Xiongwei Song <sxwjean@me.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
parent
c96900435f
commit
1da0618993
|
@ -162,6 +162,7 @@ xfs_free_perag(
|
||||||
ASSERT(pag);
|
ASSERT(pag);
|
||||||
ASSERT(atomic_read(&pag->pag_ref) == 0);
|
ASSERT(atomic_read(&pag->pag_ref) == 0);
|
||||||
xfs_buf_hash_destroy(pag);
|
xfs_buf_hash_destroy(pag);
|
||||||
|
mutex_destroy(&pag->pag_ici_reclaim_lock);
|
||||||
call_rcu(&pag->rcu_head, __xfs_free_perag);
|
call_rcu(&pag->rcu_head, __xfs_free_perag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,6 +249,7 @@ xfs_initialize_perag(
|
||||||
out_hash_destroy:
|
out_hash_destroy:
|
||||||
xfs_buf_hash_destroy(pag);
|
xfs_buf_hash_destroy(pag);
|
||||||
out_free_pag:
|
out_free_pag:
|
||||||
|
mutex_destroy(&pag->pag_ici_reclaim_lock);
|
||||||
kmem_free(pag);
|
kmem_free(pag);
|
||||||
out_unwind_new_pags:
|
out_unwind_new_pags:
|
||||||
/* unwind any prior newly initialized pags */
|
/* unwind any prior newly initialized pags */
|
||||||
|
@ -256,6 +258,7 @@ xfs_initialize_perag(
|
||||||
if (!pag)
|
if (!pag)
|
||||||
break;
|
break;
|
||||||
xfs_buf_hash_destroy(pag);
|
xfs_buf_hash_destroy(pag);
|
||||||
|
mutex_destroy(&pag->pag_ici_reclaim_lock);
|
||||||
kmem_free(pag);
|
kmem_free(pag);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
|
Loading…
Reference in New Issue