On Tue, 09 Sep 2025, Al Viro wrote: > On Tue, Sep 09, 2025 at 02:43:21PM +1000, NeilBrown wrote: > > > d_instantiate(dentry, inode); > > - dget(dentry); > > -fail: > > - inode_unlock(d_inode(parent)); > > - return dentry; > > + return simple_end_creating(dentry); > > No. This is the wrong model - dget() belongs with d_instantiate() > here; your simple_end_creating() calling conventions are wrong. I can see that I shouldn't have removed the dget() there - thanks. It is not entirely clear why hypfs_create_file() returns with two references held to the dentry.... I see now one is added either to ->update_file or the list at hypfs_last_dentry, and the other is disposed of by kill_litter_super(). But apart from that one error is there something broader wrong with the patch? You say "the wrong model" but I don't see it. Thanks, NeilBrown > > What really happens is a controlled leak. simple_start_creating() > in the beginning is correct, but the right model here is to have > identical refcounting logics on the exits - the only difference > should be in having done that combination on success. > > Please, leave those alone for now. >