<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 27, 2018, 8:48 PM David Spisla <<a href="mailto:spisla80@gmail.com">spisla80@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Dear Gluster Devels,<br><br></div>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.<br></div>Here is a piece of code from inside the worm_rename function:<br><br><br> fd_t *fd = NULL;<br> gf_dirent_t entries;<br><br> fd = fd_anonymous (oldloc->inode);<br> if (fd == NULL) {<br> gf_log (this->name, GF_LOG_ERROR, "fd creation failed");<br> ret = -ENOMEM;<br> goto out;<br> }<br> INIT_LIST_HEAD (&entries.list);<br> ret = syncop_readdir (this, fd, 131072, 0, &entries, NULL, NULL);<br> if (ret) {<br></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Poornima</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> gf_log (this->name, GF_LOG_ERROR, "failed getting dir entries");<br> ret = -ENOMEM;<br> goto out;<br> }<br><br></div><div>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?<br><br></div><div>Regards<br></div><div>David Spisla<br></div></div>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank" rel="noreferrer">Gluster-devel@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer noreferrer" target="_blank">http://lists.gluster.org/mailman/listinfo/gluster-devel</a></blockquote></div></div></div>