I have a problem with removing empty dir, strace shows error:
rmdir("empty_dir") = -1 ENOTEMPTY (Directory not empty)
And ls -la empty_dir shows nothing. So i connected to the fs (ext4) with debugfs and see the hidden file inside this dir:
# ls -lia empty_dir/
total 8
44574010 drwxr-xr-x 2 2686 2681 4096 Jan 13 17:59 .
44573990 drwxr-xr-x 3 2686 2681 4096 Jan 13 18:36 ..
debugfs: ls empty_dir
44574010 (12) . 44573990 (316) ..
26808797 (3768) _-----------------------------------------------------------.jpg
Why could this happen? And any chance to solve this problem without unmounting and full checking fs?
Additional information:
The "hidden" file is just a normal jpg file and can be opened by the image viewer:
debugfs: dump empty_dir/_-----------------------------------------------------------.jpg /root/hidden_file
# file /root/hidden_file
/root/hidden_file: JPEG image data, JFIF standard 1.02
rm -rf empty_dir is not working with the same error:
unlinkat(AT_FDCWD, "empty_dir", AT_REMOVEDIR) = -1 ENOTEMPTY (Directory not empty)
find empty_dir/ -inum 26808797 shows nothing.