On Mon, 2024-12-23 at 20:05 +0000, Al Viro wrote: > On Mon, Dec 23, 2024 at 02:52:12PM -0500, James Bottomley wrote: > > > > +static int efivarfs_file_release(struct inode *inode, struct file > > *file) > > +{ > > + inode_lock(inode); > > + if (i_size_read(inode) == 0 && !d_unhashed(file- > > >f_path.dentry)) { > > + drop_nlink(inode); > > + d_delete(file->f_path.dentry); > > + dput(file->f_path.dentry); > > + } > > + inode_unlock(inode); > > + return 0; > > +} > > This is wrong; so's existing logics for removal from write(). Think > what happens if you open the sucker, have something bound on top of > it and do that deleting write(). Shouldn't the bind have taken a dentry reference? in which case we'll just drop the dentry but it won't be the final put, so it will still hang around. > Let me look into that area... Thanks; as you say, delete from write has been around for over a decade in this filesystem. We can defer the delete, but it has to happen somewhere if a write causes an EFI variable to be removed. Regards, James