[Bugs] [Bug 1222150] readdirp return 64bits inodes even if enable-ino32 is set

bugzilla at redhat.com bugzilla at redhat.com
Wed May 20 23:22:27 UTC 2015


https://bugzilla.redhat.com/show_bug.cgi?id=1222150



--- Comment #2 from Cyril Peponnet <cyril at peponnet.fr> ---
I gave a try with RPMs generated through

http://koji.fedoraproject.org/koji/taskinfo?taskID=9810286

Seems to work fine with enable-ino32 to mount options and use 32bit binary to
call getdents syscall.

Thanks !

For the record to test it you can compile:

/*
 *  * List directories using getdents() because ls, find and Python libraries
 *   * use readdir() which is slower (but uses getdents() underneath.
 *    *
 *     * Compile with
 *      * ]$ gcc  getdents.c -o getdents
 *       */
#define _GNU_SOURCE
#include <dirent.h>     /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>

#define handle_error(msg) \
       do { perror(msg); exit(EXIT_FAILURE); } while (0)

struct linux_dirent {
   long           d_ino;
   off_t          d_off;
   unsigned short d_reclen;
   char           d_name[];
};

#define BUF_SIZE 1024*1024*5

int
main(int argc, char *argv[])
{
   int fd, nread;
   char buf[BUF_SIZE];
   struct 

with gcc -m32 getdents getdents.c


And run it like ./getdents /path/

Before the patch:

strace -e getdents ./getdents /mnt/test/
[ Process PID=15906 runs in 32 bit mode. ]
getdents(3, /* 1 entries */, 5242880)   = 16
getdents(3, 0xff8f65bf, 5242880)        = -1 EOVERFLOW (Value too large for
defined data type)
getdents: Value too large for defined data type
+++ exited with 1 +++

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=SqcUBMiMsj&a=cc_unsubscribe


More information about the Bugs mailing list