--- x/security/landlock/fs.c +++ y/security/landlock/fs.c @@ -1434,8 +1434,6 @@ static void hook_sb_delete(struct super_ spin_unlock(&inode->i_lock); continue; } - /* Keeps a reference to this inode until the next loop walk. */ - __iget(inode); spin_unlock(&inode->i_lock); /* @@ -1457,15 +1455,6 @@ static void hook_sb_delete(struct super_ * It is therefore not necessary to lock inode->i_lock. */ rcu_assign_pointer(landlock_inode(inode)->object, NULL); - /* - * At this point, we own the ihold() reference that was - * originally set up by get_inode_object() and the - * __iget() reference that we just set in this loop - * walk. Therefore the following call to iput() will - * not sleep nor drop the inode because there is now at - * least two references to it. - */ - iput(inode); } else { spin_unlock(&object->lock); rcu_read_unlock(); @@ -1479,12 +1468,7 @@ static void hook_sb_delete(struct super_ * disappear from under us until the next loop walk. */ spin_unlock(&sb->s_inode_list_lock); - /* - * We can now actually put the inode reference from the - * previous loop walk, which is not needed anymore. - */ iput(prev_inode); - cond_resched(); spin_lock(&sb->s_inode_list_lock); } prev_inode = inode;