Re: [PATCH 8/8] btrfs: sysfs: Add bdi link to the fsid dir

Josef Bacik
2020-07-02T13:25:35Z

On 7/2/20 8:23 AM, Nikolay Borisov wrote:
> Since BTRFS uses a private bdi it makes sense to create a link to this
> bdi under /sys/fs/btrfs/<UUID>/bdi. This allows size of read ahead to
> be controlled. Without this patch it's not possible to uniquely identify
> which bdi pertains to which btrfs filesystem in the fase of multiple
> btrfs filesystem.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Was confused why we needed to make sure the link existed before removing it,
since other things sysfs is smart enough to figure out. Apparently it has a
WARN_ON() if the parent isn't initialized, so the check is necessary, albeit
annoying.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef