Re: [RFC PATCH v2] fuse: add optional workqueue to periodically invalidate expired dentries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux