efivarfs: use INODE_CHILD nested lock to traverse variables on resume
Subsystems (2)
PATCH 1/1 efivarfs: use INODE_CHILD nested lock to traverse variables on resume
From: Ard Biesheuvel <[email protected]>
syzbot warns about a potential deadlock, but this is a false positive resulting from a missing lockdep annotation: iterate_dir() locks the parent whereas the inode_lock() it warns about locks the child, which is guaranteed to be a different lock.
So use inode_lock_nested() instead with the appropriate lock class.
Reported-by [email protected]
Suggested-by Al Viro <[email protected]>
Signed-off-by Ard Biesheuvel <[email protected]>
--- fs/efivarfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/efivarfs/super.c +1 -1
@@ -421,7 +421,7 @@ static bool efivarfs_actor(struct dir_context *ctx, const char *name, int len,if (err) size =0 ; -inode_lock (inode); +inode_lock_nested (inode,INODE_CHILD );i_size_write (inode, size);inode_unlock (inode);
Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog