Skip to content

Commit c4bd819

Browse files
committed
qa: test file create on damaged directory
Fixes: https://tracker.ceph.com/issues/69695 Signed-off-by: Patrick Donnelly <[email protected]>
1 parent fe3413f commit c4bd819

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

qa/tasks/cephfs/test_damage.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,33 @@ def test_dentry_first_precommit(self):
662662
self.mount_a.mount_wait()
663663
self.mount_a.run_shell_payload("stat a/ && find a/")
664664
self.fs.flush()
665+
666+
def test_missing_dirfrag_create(self):
667+
"""
668+
That the MDS won't let you manipulate dentries in a missing dirfrag.
669+
"""
670+
671+
self.mount_a.run_shell_payload("mkdir -p dir_x/dir_xx/dir_xxx/")
672+
self.mount_a.run_shell_payload("touch dir_x/dir_xx/dir_xxx/file_y")
673+
self.mount_a.umount()
674+
d = self.fs.read_cache("dir_x/dir_xx", depth=0)
675+
self.fs.flush()
676+
time.sleep(5)
677+
self.fs.flush() # EUpdate scatter_writebehind
678+
self.fs.fail()
679+
dirfrag_obj = "{0:x}.00000000".format(d[0]['ino'])
680+
self.fs.radosm(["rm", dirfrag_obj]),
681+
self.fs.set_joinable()
682+
self.fs.wait_for_daemons()
683+
self.mount_a.mount_wait()
684+
try:
685+
p = self.mount_a.run_shell_payload("touch dir_x/dir_xx/file_x", wait=False)
686+
# CDir.cc: 1438: FAILED ceph_assert(get_version() < pv)
687+
wait([p], 20)
688+
self.fs.flush()
689+
except MaxWhileTries:
690+
self.fail("MDS probably crashed")
691+
except CommandFailedError:
692+
self.assertTrue("Input/output error" in p.stderr.getvalue())
693+
else:
694+
self.fail("command should fail")

0 commit comments

Comments
 (0)