Skip to content

Commit 2c58d42

Browse files
author
Al Viro
committed
fix locking in efi_secret_unlink()
We used to need securityfs_remove() to undo simple_pin_fs() done when the file had been created and to drop the second extra reference taken at the same time. Now that neither is needed (or done by securityfs_remove()), we can simply call simple_unlink() and be done with that - the broken games with locking had been there only for the sake of securityfs_remove(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent e4de726 commit 2c58d42

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

drivers/virt/coco/efi_secret/efi_secret.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,7 @@ static int efi_secret_unlink(struct inode *dir, struct dentry *dentry)
136136
if (s->fs_files[i] == dentry)
137137
s->fs_files[i] = NULL;
138138

139-
/*
140-
* securityfs_remove tries to lock the directory's inode, but we reach
141-
* the unlink callback when it's already locked
142-
*/
143-
inode_unlock(dir);
144-
securityfs_remove(dentry);
145-
inode_lock(dir);
146-
147-
return 0;
139+
return simple_unlink(inode, dentry);
148140
}
149141

150142
static const struct inode_operations efi_secret_dir_inode_operations = {

0 commit comments

Comments
 (0)