Bug #10164
closedDirfrag objects for deleted dir not purged until MDS restart
0%
Description
Seen while playing with the #9881 flush functionality: the dirfrag objects for deleted directories are never cleaned up after the directory is unlinked.
On a fresh vstart FS client mount:
$ mkdir alpha
$ rmdir alpha
$ sync
./ceph daemon mds.a flush journal
./rados -p cephfs_metadata ls | grep 10000000000
10000000000.00000000
...the object is still there for the dirfrag (including after waiting a while).
Restart the MDS, and the object is removed during MDCache::scan_stray_dir.
The log output from eval_stray indicates it's failing the in->dirfrags.empty() condition.
There is also another case where if there was a child file, and the client still holds the cap for the directory it just deleted (as the fuse client does), eval_stray fails on the in->is_any_caps condition.