scoutfs: destroy items after locks

We were destroying the item subsystem before shutting down locking.
This is wrong because locking shutdown invalidates items covered by the
locks.  It can walk into freed memory and crash or corrupt other memory.

The fix is to tear down the item subsystem after tearing down locks.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-08-23 16:23:57 -07:00
committed by Zach Brown
parent ed9f4b6a22
commit f06b39cd7e

View File

@@ -129,7 +129,6 @@ static void scoutfs_put_super(struct super_block *sb)
scoutfs_shutdown_trans(sb);
scoutfs_client_destroy(sb);
scoutfs_inode_destroy(sb);
scoutfs_item_destroy(sb);
/* the server locks the listen address and compacts */
scoutfs_lock_shutdown(sb);
@@ -138,6 +137,7 @@ static void scoutfs_put_super(struct super_block *sb)
scoutfs_seg_destroy(sb);
scoutfs_lock_destroy(sb);
scoutfs_item_destroy(sb);
scoutfs_destroy_triggers(sb);
scoutfs_options_destroy(sb);
debugfs_remove(sbi->debug_root);