> hm. can you show me the relevant part of > $ strace -v -o /tmp/ls0.txt ls -1 /mnt/test I've attached both files mount.strace as well as ls-l.strace.
>
> Iff you have a high st_ino, can you try to mount with noserverino to
> workaround it?
That is what I already did - thanks anyway.
> To your other question...
> >>> The root cause I am searching for is related to an error of fstat on a
> >>> CIFS mounted folder using the option <nounix>. This option causes the
> kernel
> >>> to map the server inodes to large values (> 32 bit). Thus the fstat
> call
> >>> returns with a <Value too large for defined data type> error. An <ls>
> call on
> >>> that folder shows the following syscalls:
>
> >>> open("/mnt/test/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
> >>> fstat(3, 0x7fe6ebb8) = -1 EOVERFLOW (Value too
> large
> >>> for defined data type)
>
> >>> Assumed that ls calls opendir, then the 64 bit handling of fstat is
> >>> missing, right?
>
> ... it could be that the conversion is going wrong, yes.
> thanks,
At the moment I am using the attached patch to fix it at my side. The file
ls-l-fixed.strace contains the log of the ls -l call using the patch.
BR
Martin
mount.strace
Description: Binary data
ls-l.strace
Description: Binary data
Index: opendir.c
===================================================================
--- opendir.c (revision 6083)
+++ opendir.c (revision 6084)
@@ -16,6 +16,16 @@
#include <dirent.h>
#include "dirstream.h"
+#if defined __UCLIBC_HAS_LFS__
+ #define _stat stat64
+ #define _fstat fstat64
+ #define _struct_stat struct stat64
+#else
+ #define _stat stat
+ #define _fstat fstat
+ #define _struct_stat struct stat
+#endif
+
static DIR *fd_to_DIR(int fd, __blksize_t size)
{
DIR *ptr;
@@ -43,9 +53,9 @@
DIR *fdopendir(int fd)
{
int flags;
- struct stat st;
+ _struct_stat st;
- if (fstat(fd, &st))
+ if (_fstat(fd, &st))
return NULL;
if (!S_ISDIR(st.st_mode)) {
__set_errno(ENOTDIR);
@@ -69,12 +79,12 @@
DIR *opendir(const char *name)
{
int fd;
- struct stat statbuf;
+ _struct_stat statbuf;
DIR *ptr;
#ifndef O_DIRECTORY
/* O_DIRECTORY is linux specific and has been around since like 2.1.x */
- if (stat(name, &statbuf))
+ if (_stat(name, &statbuf))
return NULL;
if (!S_ISDIR(statbuf.st_mode)) {
__set_errno(ENOTDIR);
@@ -90,7 +100,7 @@
* defined and since Linux has supported it for like ever, i'm not going
* to worry about it right now (if ever). */
- if (fstat(fd, &statbuf) < 0) {
+ if (_fstat(fd, &statbuf) < 0) {
/* this close() never fails
*int saved_errno;
*saved_errno = errno; */
ls-l-fixed.strace
Description: Binary data
_______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
