From f06b39cd7e4f380dc503fa44d9bff561a8cba295 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 23 Aug 2018 16:23:57 -0700 Subject: [PATCH] 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 --- kmod/src/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/super.c b/kmod/src/super.c index d9540334..28773a3e 100644 --- a/kmod/src/super.c +++ b/kmod/src/super.c @@ -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);