From c4cf1acdb186436b88cc9aeaf08322bc49fec183 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 20 Apr 2017 15:09:05 -0700 Subject: xfs: better log intent item refcount checking Use ASSERTs on the log intent item refcounts so that we fail noisily if anyone tries to double-free the item. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_refcount_item.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/xfs/xfs_refcount_item.c') diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index 6e4c7446c3d4..96fe209b5eb6 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c @@ -221,6 +221,7 @@ void xfs_cui_release( struct xfs_cui_log_item *cuip) { + ASSERT(atomic_read(&cuip->cui_refcount) > 0); if (atomic_dec_and_test(&cuip->cui_refcount)) { xfs_trans_ail_remove(&cuip->cui_item, SHUTDOWN_LOG_IO_ERROR); xfs_cui_item_free(cuip); -- cgit