File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments