summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_refcount_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-04-21 00:09:05 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2017-04-25 18:40:42 +0200
commitc4cf1acdb186436b88cc9aeaf08322bc49fec183 (patch)
tree182b16a4ff2cb81bf720e4d7d2666fa4851cee60 /fs/xfs/xfs_refcount_item.c
parentxfs: fix up quotacheck buffer list error handling (diff)
downloadlinux-c4cf1acdb186436b88cc9aeaf08322bc49fec183.tar.xz
linux-c4cf1acdb186436b88cc9aeaf08322bc49fec183.zip
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 <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_refcount_item.c')
-rw-r--r--fs/xfs/xfs_refcount_item.c1
1 files changed, 1 insertions, 0 deletions
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);