[Gluster-devel] Invalid DIR * usage in quota xlator

J. Bruce Fields bfields at fieldses.org
Wed Oct 15 17:54:32 UTC 2014


On Wed, Oct 15, 2014 at 07:42:25PM +0200, Emmanuel Dreyfus wrote:
> J. Bruce Fields <bfields at fieldses.org> wrote:
> 
> > You're assuming no filesystem uses -1 as a cookie?
> > Might be true, but it's taking a small chance.
> 
> Latest version does not work like this anymore: when EOF is reached,
> current offset is recorded in pfd->dir_eof, and we fire EINVAL if
> seekdir() failed to set the offset and the offset is not  pfd->dir_eof:
> 
>                 if (telldir(dir) != (long)off && off != pfd->dir_eof)

But actually, I was wrong: telldir returns -1 for error or offset on
success, so -1 is reserved.

--b.


More information about the Gluster-devel mailing list