When a xfs partition is mounted using allocsize and largeio (but no swidth), the value of st_blksize is set to allocsize in bytes. This can cause unreasonable amount of memory being allocated as allocsize can be up to 1Gib. On a system with 1Gb of memory, with the xfs mount options: allocsize=512m,largeio , having 1 large file open, and trying to list a point on the filesystem results in ENOMEM error. For more details, please look at: https://bugzilla.redhat.com/show_bug.cgi?id=430768 for more specifics (including strace). (the person who posted it helped me to debug it) Memory allocation for opendir is done in glibc, file: sysdeps/unix/opendir.c Some sort of upper boundary should be placed on the memory allocation, or a fallback in case ENOMEM occurs. When looking around about this problem, I also came across: http://sources.redhat.com/bugzilla/show_bug.cgi?id=4099 which is related by the way st_blksize is being used.