On Tue, Mar 27, 2018, 8:48 PM David Spisla <spisla80@xxxxxxxxx> wrote:
Here is a piece of code from inside the worm_rename function:Dear Gluster Devels,I want to read all the entries in a DIR inside of a xlator. For this purpose I use the syncop_readdir function which is also used in die self-heal functionality for example.
fd_t *fd = NULL;
gf_dirent_t entries;
fd = fd_anonymous (oldloc->inode);
if (fd == NULL) {
gf_log (this->name, GF_LOG_ERROR, "fd creation failed");
ret = -ENOMEM;
goto out;
}
INIT_LIST_HEAD (&entries.list);
ret = syncop_readdir (this, fd, 131072, 0, &entries, NULL, NULL);
if (ret) {
Readdir returns the number of entries read, hence ret will be > 0, if there are dir entries read and it's a success case. The check should be ret < 0. If it fails with ret < 0 case then I would suspect fd_anonymous, I m not sure whether it works for readdir, need to check the code.
Regards,
Poornima
_______________________________________________gf_log (this->name, GF_LOG_ERROR, "failed getting dir entries");
ret = -ENOMEM;
goto out;
}The problem is, that I always get the Error: "failed getting dir entries" . It seems to be that there is something wrong with the execution of that function. Any ideas?RegardsDavid Spisla
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel
_______________________________________________ Gluster-devel mailing list Gluster-devel@xxxxxxxxxxx http://lists.gluster.org/mailman/listinfo/gluster-devel