From 18171b854356b673770103d146689e89af03a542 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 10 Mar 2022 10:50:31 -0800 Subject: [PATCH] Put allocator block references on forced unmount During forced unmount commits abort due to errors and the open transaction is left in a dirty state that is cleaned up by scoutfs_shutdown_trans(). It cleans all the dirty blocks in the commit write context with scoutfs_block_writer_forget_all(), but it forgot to call scoutfs_alloc_prepare_commit() to put the block references held by the allocator. This was generating leaked block warnings during testing that used forced unmount. It wouldn't affect regular operations. Signed-off-by: Zach Brown --- kmod/src/trans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kmod/src/trans.c b/kmod/src/trans.c index 14e45c15..bc07071b 100644 --- a/kmod/src/trans.c +++ b/kmod/src/trans.c @@ -640,6 +640,7 @@ void scoutfs_shutdown_trans(struct super_block *sb) tri->write_workq = NULL; } + scoutfs_alloc_prepare_commit(sb, &tri->alloc, &tri->wri); scoutfs_block_writer_forget_all(sb, &tri->wri); kfree(tri);