On Tue, 15 Apr 2025 at 15:38, Luis Henriques <luis@xxxxxxxxxx> wrote: > +inval_wq=N > + Enable a workqueue that will periodically invalidate dentries that > + have expired. 'N' is a value in seconds and has to be bigger than > + 5 seconds. > + I don't think a mount option is needed. Perhaps a module option knob instead is sufficient? > +static void fuse_dentry_tree_add_node(struct dentry *dentry) > +{ > + struct fuse_conn *fc = get_fuse_conn_super(dentry->d_sb); > + struct dentry_node *dn, *cur; > + struct rb_node **p, *parent = NULL; > + bool start_work = false; > + > + if (!fc->inval_wq) > + return; > + > + dn = kmalloc(sizeof(*dn), GFP_KERNEL); > + if (!dn) > + return; > + dn->dentry = dget(dentry); A dentry ref without a vfsmount ref is generally bad idea. Instead of acquiring a ref, the lifetime of dn should be tied to that of the dentry (hook into ->d_prune). So just put the rb_node in fuse_dentry and get rid of the "#if BITS_PER_LONG >= 64" optimization. Thanks, Miklos