On Sun, Jan 12, 2025 at 08:06:48AM +0000, Al Viro wrote: > The reason we need that crap is the dual use ->d_fsdata has there - > it's both holding a debugfs_fsdata reference after the first > debugfs_file_get() (actually, after the call of proxy ->open()) > *and* it serves as a place to stash a reference to real file_operations > from object creation to the first open. Oh, and it's triple use, > actually - that stashed reference might be to debugfs_short_fops. > > Bugger that for a game of solidiers - just put the operations The most confusing part of this patch is this sentence. :) "game of solidiers"? > reference into debugfs-private augmentation of inode. And split > debugfs_full_file_operations into full and short cases, so that > debugfs_get_file() could tell one from another. > > Voila - ->d_fsdata holds NULL until the first (successful) debugfs_get_file() > and a reference to struct debugfs_fsdata afterwards. > > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > --- Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>