Bug #58294
closedMDS: scan_stray_dir doesn't walk through all stray inode fragment
100%
Description
After commit 28227872295ae657a0d26a3f004c54c41794db18 mds: automatically fragment stray dirs
stray dirs are allowed to be fragment.
But scan_stray_dir doesn't walk through all fragments of the stray inodes correctly.
It doesn't reset next.frag after each run of stray dir inode.
Therefore, next stray inode will start from the last fragment of previous stray inode, and the preceding fragments are all skipped.
For example,
suppose stray inode 0x601 has the following fragments
0x00
0x01
0x10
0x11
If fragment 0x01 is not complete, dir would send a fetch request and next is set with ino=0x601, fragment=0x01.
After all 0x601 fragments finishes, next remains the same as ino=0x601, fragment=0x01.
All inode 0x602~0x609's fragments that are < 0x01 won't be processed.