]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: fix crash in hash_into_rank_bucket() when max_mds is 0
authorchungfengz <chungfengz@synology.com>
Thu, 16 Apr 2026 06:53:51 +0000 (06:53 +0000)
committerVenky Shankar <vshankar@redhat.com>
Mon, 8 Jun 2026 09:05:19 +0000 (14:35 +0530)
commitde9db7ce99fb6b3e4810be666b0fd5e8bbb31bf7
tree4afad4079f154c6cf330426f934fcaced1beb932
parent44f1f41750fc2443b1e480d41763ef8c4feb0924
mds: fix crash in hash_into_rank_bucket() when max_mds is 0

When a CephFS cluster is paused (e.g. via `ceph fs set <fs> down true`
or `ceph fs pause`) the MDS map's max_mds is set to 0.  Any subsequent
call to hash_into_rank_bucket() with max_mds == 0 triggers a crash:
the jump-consistent-hash loop never executes (j starts at 0, condition
j < max_mds is immediately false), leaving b = -1, so the final
assert(result >= 0 && result < max_mds) aborts the daemon.

Fixes: https://tracker.ceph.com/issues/76059
Signed-off-by: chungfengz <chungfengz@synology.com>
src/mds/MDCache.cc