Case closed.

It is a Qt bug to use opendir (src/corelib/io/qfsfileengine_iterator_unix.cpp) trying to access directory in large filesystem.

scandir64 fixes the problem

Qt Code:
  1. static QStringList getFileList( const char* dirname, const QRegExp& filter )
  2. {
  3. QStringList fileList;
  4.  
  5. struct dirent64 **namelist=NULL;
  6. int sz = scandir64( dirname, &namelist, 0 , alphasort );
  7. for ( int idx=0; idx < sz; idx++ ) {
  8. if ( QString( namelist[idx]->d_name ).contains( filter ) ) {
  9. QString fullpath( dirname );
  10. fullpath += "/";
  11. fullpath += namelist[idx]->d_name;
  12. fileList << fullpath;
  13. }
  14. }
  15.  
  16. if ( sz > 0 ) {
  17. while( sz-- ) {
  18. free( namelist[sz] );
  19. }
  20. free( namelist );
  21. }
  22.  
  23. return fileList;
  24.  
  25. } // getFileList
To copy to clipboard, switch view to plain text mode