stat() may not work on mounted CIFS' in 32 bit systems if you do not specify the option noserverino when mounting. E.g:
mount -t cifs -o user="user",password="password",noserverino //example.local/share /mnt/mount-point
Other functions based on stat() data such as file time functions and is_dir() are affected the same way.
This happens because if you do not specify the option noserverino the remote inode may be 64 bit-based and thus the local system cannot handle it.