gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] weird response of gluster_readdir


From: Shehjar Tikoo
Subject: Re: [Gluster-devel] weird response of gluster_readdir
Date: Fri, 31 Jul 2009 18:03:49 +0530
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Dongmin Yu wrote:
Hello,

I’m using glusterfs-2.0.4 and building a c-program with libglusterfsclient.

I’ve created a directory, ‘test’ and wrote a file, ‘hello.txt’, to the directory on glusterfs mounted volume.

Then I wanted to list all the files/sub-directories in the directory.

My code was as followings,

======

struct dirent *dirp = NULL;

glusterfs_dir_t dirfd = NULL;

char *path = “/gfs_mount/test/”;

dirfd = glusterfs_opendir(path);


Before you can use libglusterfsclient API, you need to set up
a few things using the glusterfs_mount call. If that wasnt done,
glusterfs_opendir should have returned a NULL, thats the first
bug here I think. Can you confirm if you called glusterfs_mount
in the full program?

Have you looked at booster? It is a library that you LD_PRELOAD
under your regular applications so that file system access
happens over libglusterfsclient, without the need to adapt
apps to libglusterfsclient.
For more info, see http://www.gluster.org/docs/index.php/BoosterConfiguration

-Shehjar

while( (dirp = glusterfs_readdir(dirfd) != NULL) ){

printf("## %s %d %d\n", dirp->d_name, dirp->d_type, dirp->d_reclen  );

        for( i = 0 ; i < 256; i++ ){

            printf("%d ", dirp->d_name[i]);

        }

        printf("\n");}

glusterfs_closedir(dirfd);

=====

What I expected result was,

## Hello.txt 8 24

## . 4 16

## .. 4 16

But

##  0 74

0 0 0 0 0 0 0 0 46 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

As you see, first 8 bytes has garbage data and d_type value is not correct.

Is it a bug of readdir or am I mis-using the library?

Thanks

*DongMin Yu*

HOSTWAY IDC Corp. / R&D Principal Researcher

TEL. +822 2105 6037

FAX. +822 2105 6019

CELL. +8216 2086 1357

EMAIL: address@hidden <mailto:address@hidden>

Website: http://www.hostway.com

*NOTICE: This email and any file transmitted are confidential and/or legally privileged and intended only for the person(s) directly addressed. If you are not the intended recipient, any use, copying, transmission, distribution, or other forms of dissemination is strictly prohibited. If you have received this email in error, please notify the sender immediately and permanently delete the email and files, if any.*


------------------------------------------------------------------------

_______________________________________________
Gluster-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/gluster-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]