]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: make group and group snapshot IDs more random 57091/head
authorIlya Dryomov <idryomov@gmail.com>
Wed, 17 Apr 2024 18:31:02 +0000 (20:31 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 25 Apr 2024 11:53:44 +0000 (13:53 +0200)
commit162e77fc1da8b55ab34d5f514894732c0df516b4
tree32507b6d31fcf33c4870873a5cad55305d30773b
parentdc093b5e41f728edab6e0330295fdf9156d31664
librbd: make group and group snapshot IDs more random

Image IDs suffered from the same issue -- it was addressed in commit
be8373688c1b ("librbd: block_name_prefix is not created randomly").
The code for generating group IDs is duplicated in api/Group.cc and
got missed.

Instead of cut-and-pasting the fix, just call generate_image_id()
directly and rename variables for more explicitness.

Before:

  $ rados -p rbd ls | grep rbd_group_header
  rbd_group_header.10256b8b4567
  rbd_group_header.10216b8b4567
  rbd_group_header.10236b8b4567
  rbd_group_header.101f6b8b4567

After:

  $ rados -p rbd ls | grep rbd_group_header
  rbd_group_header.10255f555a5
  rbd_group_header.1023f347eafb
  rbd_group_header.101f24c75111
  rbd_group_header.1021dda4e122

Fixes: https://tracker.ceph.com/issues/65573
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 76ed07d2d8085b733f51540154cfaf917db05e86)
src/librbd/Utils.cc
src/librbd/api/Group.cc