I have a specific directory where I am unable to delete the files or the directory. The directory is on an ext4 file system, using RAID5 over 3 disks on a QNAP NAS.
Using rm -f gives me:
rm: unable to stat `file.jpg': Input/output error  And also shows the following on dmesg:
EXT4-fs error (device dm-0): dx_probe:933: inode #55050534: block 3591: comm rm: Directory hole found  Since the "Input/output error" usually means hardware, I have run several tests such as what I assume is QNAP's version of fsck, badblocks, as well as the SMART rapid and long tests on the individual disks, plus raid scrubbing gets run periodically anyway - and all have come back saying no errors.
The folder has a lot of files as it's blackhole for thousands of files added daily/hourly (unable to count them as ls | wc suffers from the "Input/output error" and "Directory hole found" errors) - so based on similar black hole post) I'm assuming I've trashed the directory and not the hardware.
Unfortunately the version of find on the QNAP does not support the -exec argument, and so I cannot try what was suggested in that post. 
The questions are:
- What exactly is a 'Directory hole',
 - How can I delete the directory and files within a directory hole.
 
fsck.ext4, but I don't know how to run that on a NAS.fsck.ext4would be good. However, a QNAP FS check runs/bin/e2fsck -C 0 -fp -N /dev/mapper/cachedev1- only the command line params don't make sens - and QNAP tells me they have their own modified and recompiled version of e2fsck with different arguments. They also keep telling me silly answers like 'its due to something accessing the file' - and so I don't know what to believe from them, and don't seem to be getting anywhere with the open ticket, hence coming here.