From: chungfengz Date: Thu, 16 Apr 2026 06:54:16 +0000 (+0000) Subject: mds: fix shutdown hang when ephemeral pins active and max_mds is 0 X-Git-Tag: v21.0.1~26^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68413%2Fhead;p=ceph.git mds: fix shutdown hang when ephemeral pins active and max_mds is 0 During shutdown, `ceph fs set down true` sets max_mds to 0 before the MDS daemons have finished exporting their subtrees. shutdown_pass() iterates over auth subtrees and skips any dir whose inode is ephemerally pinned, expecting handle_export_pins() to re-place them. However, handle_export_pins() calls hash_into_rank_bucket() which (after the companion fix) now returns MDS_RANK_NONE when max_mds == 0. With no valid target rank the export is never scheduled, so the ephemerally- pinned dirs are skipped by shutdown_pass() indefinitely and the daemon loops. Fixes: https://tracker.ceph.com/issues/76059 Signed-off-by: chungfengz --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 268f7122069..521ed40a109 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8018,7 +8018,8 @@ bool MDCache::shutdown_pass() dir->is_freezing() || dir->is_ambiguous_dir_auth() || dir->state_test(CDir::STATE_EXPORTING) || - dir->get_inode()->is_ephemerally_pinned()) { + (mds->mdsmap->get_max_mds() > 0 && + dir->get_inode()->is_ephemerally_pinned())) { continue; } ls.push_back(dir);