Project

General

Profile

Actions

Bug #76455

closed
VS VS

src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops()

Bug #76455: src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops()

Added by Venky Shankar 7 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
Due date:
% Done:

0%

Source:
other
Backport:
tentacle,squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
crash
Pull request ID:
Tags (freeform):
Fixed In:
v21.0.0-2097-g197d4537e2
Released In:
v21.2.0~260
Upkeep Timestamp:
2026-10-28T01:09:59+00:00

Description

CDir::_omap_commit_ops() has:

  // the last omap commit includes the omap header, so account for
  // that size early on so that when we reach `commit_one(true)`,
  // there is enough space for the header.
  write_size += sizeof(fnode_t);
  using ceph::encode;
  for (auto &item : to_set) {
    bufferlist bl;
    encode(item.first, bl);
    if (item.is_remote) {
      // remote link
      CDentry::encode_remote(item.ino, item.d_type, item.alternate_name, bl);
    } else {
      // marker, name, inode, [symlink string]
      bl.append('i');         // inode

      ENCODE_START(2, 1, bl);
      // WARNING: always put new fields at the end of bl
      encode(item.alternate_name, bl);
      _encode_primary_inode_base(item, dfts, bl);
      ENCODE_FINISH(bl);
    }

    unsigned size = item.key.length() + bl.length() + 2 * sizeof(__u32);
    if (write_size > 0 && write_size + size > max_write_size)
      commit_one();

    write_size += size;
    _set[std::move(item.key)] = std::move(bl);

    if (!(++count % mdcache->mds->heartbeat_reset_grace()))
      mdcache->mds->heartbeat_reset();
  }

If stales and to_remove are empty, write_size is initialised with sizeof(fnode_t);. That satisfies the following condition

    unsigned size = item.key.length() + bl.length() + 2 * sizeof(__u32);
    if (write_size > 0 && write_size + size > max_write_size)
      commit_one();

if size is large enough to to exceed max_dir_commit_size (90MB), which is incredibly large of an encoded inode. We have seen an instance before where for some reason the encoded snaprealm grows to huge sizes. Anyway, when the condition is satisfied above, commit_one() is called with empty _set, _rm and header=false causing the assert to hit.


Related issues 3 (1 open — 2 closed)

Related to CephFS - Bug #67102: mds: read-only file system due to large old_inodesFix Under ReviewVenky Shankar

Actions
Copied to CephFS - Backport #77228: tentacle: src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops()ResolvedVenky Shankar

Actions
Copied to CephFS - Backport #77229: squid: src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops()ResolvedVenky Shankar

Actions

VS Updated by Venky Shankar 7 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Backport set to tentacle,squid
  • Pull request ID set to 68793

UB Updated by Upkeep Bot 6 months ago Actions #2

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to 197d4537e2efdc48d9d7a078e6d90d10afcbf452
  • Fixed In set to v21.0.0-2097-g197d4537e2
  • Upkeep Timestamp set to 2026-06-08T08:55:54+00:00

UB Updated by Upkeep Bot 6 months ago Actions #3

  • Copied to Backport #77228: tentacle: src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops() added

UB Updated by Upkeep Bot 6 months ago Actions #4

  • Copied to Backport #77229: squid: src/mds/CDir.cc: 2448: FAILED ceph_assert(header || !_set.empty() || !_rm.empty()) in CDir::_omap_commit_ops() added

UB Updated by Upkeep Bot 6 months ago Actions #5

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #6

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-06-08T08:55:54+00:00 to 2026-08-27T18:33:49+00:00

VS Updated by Venky Shankar about 2 months ago Actions #7

  • Related to Bug #67102: mds: read-only file system due to large old_inodes added

UB Updated by Upkeep Bot about 1 month ago Actions #8

  • Released In set to v21.2.0~260
  • Upkeep Timestamp changed from 2026-08-27T18:33:49+00:00 to 2026-10-24T01:18:15+00:00

UB Updated by Upkeep Bot about 1 month ago Actions #9

  • Status changed from Backporting to Resolved
  • Upkeep Timestamp changed from 2026-10-24T01:18:15+00:00 to 2026-10-28T01:09:59+00:00
Actions

Also available in: PDF Atom