Skip to content

Commit 2a0e857

Browse files
josefbacikebiggers
authored andcommitted
fs: move fscrypt keyring destruction to after ->put_super
btrfs has a variety of asynchronous things we do with inodes that can potentially last until ->put_super, when we shut everything down and clean up all of our async work. Due to this we need to move fscrypt_destroy_keyring() to after ->put_super, otherwise we get warnings about still having active references on the master key. Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 275dca4 commit 2a0e857

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/super.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,6 @@ void generic_shutdown_super(struct super_block *sb)
681681
fsnotify_sb_delete(sb);
682682
security_sb_delete(sb);
683683

684-
/*
685-
* Now that all potentially-encrypted inodes have been evicted,
686-
* the fscrypt keyring can be destroyed.
687-
*/
688-
fscrypt_destroy_keyring(sb);
689-
690684
if (sb->s_dio_done_wq) {
691685
destroy_workqueue(sb->s_dio_done_wq);
692686
sb->s_dio_done_wq = NULL;
@@ -695,6 +689,12 @@ void generic_shutdown_super(struct super_block *sb)
695689
if (sop->put_super)
696690
sop->put_super(sb);
697691

692+
/*
693+
* Now that all potentially-encrypted inodes have been evicted,
694+
* the fscrypt keyring can be destroyed.
695+
*/
696+
fscrypt_destroy_keyring(sb);
697+
698698
if (CHECK_DATA_CORRUPTION(!list_empty(&sb->s_inodes),
699699
"VFS: Busy inodes after unmount of %s (%s)",
700700
sb->s_id, sb->s_type->name)) {

0 commit comments

Comments
 (0)