Re: [PATCH] fs: use xarray for old mount id

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

 



On Tue, 17 Dec 2024 at 13:23, Christian Brauner <brauner@xxxxxxxxxx> wrote:

> @@ -270,18 +270,19 @@ static inline struct hlist_head *mp_hash(struct dentry *dentry)
>
>  static int mnt_alloc_id(struct mount *mnt)
>  {
> -       int res = ida_alloc(&mnt_id_ida, GFP_KERNEL);
> +       int res;
>
> -       if (res < 0)
> -               return res;
> -       mnt->mnt_id = res;
> -       mnt->mnt_id_unique = atomic64_inc_return(&mnt_id_ctr);
> +       xa_lock(&mnt_id_xa);
> +       res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, XA_LIMIT(1, INT_MAX), GFP_KERNEL);

This uses a different allocation strategy, right?  That would be a
user visible change, which is somewhat risky.

> +       if (!res)
> +               mnt->mnt_id_unique = ++mnt_id_ctr;
> +       xa_unlock(&mnt_id_xa);
>         return 0;

        return res;

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