On Wed, Sep 09, 2020 at 08:46:01PM +0200, Max Reitz wrote:
> @@ -176,13 +177,22 @@ static ssize_t 
> fuse_conn_congestion_threshold_write(struct file *file,
>  
>       spin_lock(&fc->bg_lock);
>       fc->congestion_threshold = val;
> -     if (fc->sb) {
> +
> +     /*
> +      * Get any fuse_mount belonging to this fuse_conn; s_bdi is
> +      * shared between all of them
> +      */
> +     if (!list_empty(&fc->mounts))
> +             first_fm = list_first_entry(&fc->mounts, struct fuse_mount,
> +                                         fc_entry);
...
> @@ -263,14 +273,20 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry 
> *parent,
>  int fuse_ctl_add_conn(struct fuse_conn *fc)
>  {
>       struct dentry *parent;
> +     struct fuse_mount *first_fm;
>       char name[32];
>  
>       if (!fuse_control_sb)
>               return 0;
>  
> +     if (list_empty(&fc->mounts))
> +             return 0;
> +
> +     first_fm = list_first_entry(&fc->mounts, struct fuse_mount, fc_entry);
> +     sprintf(name, "%u", first_fm->dev);

How does locking work for struct fuse_mount? Are there any locking rules
that can be documented?

Stefan

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Virtio-fs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virtio-fs

Reply via email to