Skip to contentSkip to conversation

sunrpc: destroy rpc_inode_cachep after unregister_filesystem

PATCH New Dan Aloni 1 participant 1 message Jun 26, 2020

Subsystems (3)
lore
Share & tools
lore

Dan Aloni

author
#0 lore raw

PATCH 1/1 sunrpc: destroy rpc_inode_cachep after unregister_filesystem

Better to unregister the file system before destroying the kmem_cache cache of the inodes, so that the inodes are freed before we are trying to destroy it. Otherwise, kmem_cache yells that some objects are live.

---
 net/sunrpc/rpc_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/rpc_pipe.c +1 -1
index 39e14d5edaf1..111f0b2e174f 100644
@@ -1509,6 +1509,6 @@ int register_rpc_pipefs(void)
 void unregister_rpc_pipefs(void)
 {
 	rpc_clients_notifier_unregister();
-	kmem_cache_destroy(rpc_inode_cachep);
 	unregister_filesystem(&rpc_pipe_fs_type);
+	kmem_cache_destroy(rpc_inode_cachep);
 }
Signature · 1 line
2.25.4