GrepBoard/Manuals
605 manuals ·

CephFS inode 0x10000000000 prefix: allocating rank, not authority

·Tested on Ceph Reef 18.2 · Squid 19.2 official docs and source · 2026-10·Test scope ↓·5 steps

A CephFS inode number prefix names the MDS rank that allocated it, not the rank that owns the inode now. Why the source says so, and how to see authority.

console
$ stat -c %i /mnt/cephfs/dir/file$ echo $(( $(stat -c %i /mnt/cephfs/dir/file) >> 40 ))

The prefix of an inode number such as 0x10000000000 or 0x20000000000 names the MDS rank that allocated it, not the rank that owns the inode now. The second line shifts the inode number right by 40 bits. For a regular inode allocated by an MDS created fresh, the result is the allocating rank number plus one. That says which rank allocated the number. It does not say which rank manages the inode now (its authority).

[1] Check the number ranges in the source. A new rank's InoTable starts out with the free range from (rank+1) << 40, 1 << 40 numbers long ([InoTable.cc L27-L39](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/InoTable.cc#L27-L39); Reef 18.2.4 has the same formula). That initial state is set when a new rank boots (boot_create, [MDSRank.cc L2217-L2220](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L2217-L2220)). As a table:

rankstarthex
01 << 400x10000000000
12 << 400x20000000000
23 << 400x30000000000

Each rank keeps its own table, stored in the metadata pool as an object named mds<rank>_inotable ([MDSTable.cc L144-L150](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSTable.cc#L144-L150)). System inodes such as the root 1, the per-rank MDS directories and stray directories use small constant numbers far below 1 << 40. The root is CEPH_INO_ROOT = 1 ([ceph_fs.h L52](https://github.com/ceph/ceph/blob/v19.2.3/src/include/ceph_fs.h#L52)); the other system numbers sit below MDS_INO_SYSTEM_BASE = (6*MAX_MDS) + (MAX_MDS * NUM_STRAY), which is 4096 with MAX_MDS 0x100 ([types.h L46](https://github.com/ceph/ceph/blob/v19.2.3/src/include/cephfs/types.h#L46)) and NUM_STRAY 10 ([mdstypes.h L41-L66](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/mdstypes.h#L41-L66)). A number whose >> 40 is 0 is a system inode outside this rule.

[2] See why the number means "who allocated it". The MDS that handles a create request picks the number in prepare_new_inode. It uses one from the client session's pre-allocated set if there is one; otherwise it takes one from its own inotable with project_alloc_id. The pre-allocated numbers also come from the same MDS's inotable ([Server.cc L3477-L3535](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/Server.cc#L3477-L3535)). So the prefix belongs to the rank that handled the create. Create requests go through rdlock_path_xlock_dentry, whose comment says "make sure i am auth for that dentry … forward as necessary", so a rank that is not authoritative for the directory receiving the new name forwards the request. The openc, mknod and mkdir handlers call it ([Server.cc L3786-L3795](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/Server.cc#L3786-L3795), L4731, L7255, L7357).

[3] Authority is decided without the number. CInode::authority() returns the inode's explicitly set value if there is one, otherwise the authority of its parent directory fragment ([CInode.cc L3046-L3055](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/CInode.cc#L3046-L3055)). A directory fragment follows its own dir_auth if it is a subtree root, and otherwise its inode's authority ([CDir.cc L3007-L3013](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/CDir.cc#L3007-L3013)). The inode number is used nowhere in that chain. When a subtree moves to another rank (pinning, ceph.dir.pin, or the balancer), authority changes and the already assigned number does not. A file whose >> 40 is 1 can therefore live on rank 1 or any other rank today. Subtree pinning is described in the Multiple Active MDS doc.

[4] Know the exception. The docs list cephfs-table-tool ... reset inode, which returns the InoTable to its initial state (recovery doc L143-L144). That command resets the InoTable with reset_state, which marks the whole (rank+1) << 40 range from [1] as free again ([InoTable.cc L27-L39](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/InoTable.cc#L27-L39)). The prefix-to-allocating-rank mapping does not change; numbers already used just look free again. A number says only which rank allocated it at that time. This article does not cover using that tool.

[5] Here is how to look at authority. get subtrees and dump tree are not in the official docs (not found anywhere in them). In the source they are registered as MDS admin socket commands ([MDSDaemon.cc L387-L392 · L462-L465](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSDaemon.cc#L387-L392)). They are read-only dumps and show only what is in that MDS's cache.

console
$ ceph tell mds.cephfs:0 get subtrees$ ceph tell mds.cephfs:0 dump tree /dir 1

get subtrees prints is_auth, auth_first, auth_second and the pin (export_pin) per subtree ([MDSRank.cc L3230-L3262](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L3230-L3262)). dump tree <root path> [depth] dumps the inodes under that path with their directory fragments, and each fragment entry carries dir_auth ([CInode.cc L5263-L5271](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/CInode.cc#L5263-L5271), [CDir.cc L3628-L3636](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/CDir.cc#L3628-L3636)). Command names and arguments come from the source; the output format may differ between releases, so no sample output is shown. Use ceph fs status to see which rank to ask.

#ceph#cephfs#mds#inode#InoTable