[Gluster-devel] op_ret checking in pl_open_cbk

Vikas Gorur vikas at zresearch.com
Tue Mar 4 13:51:53 UTC 2008

Excerpts from LI Daobing's message of Tue Mar 04 15:19:29 +0530 2008:
> Hello,
> there is a checking in pl_open_cbk, it's "if (op_ret == 0)", i think
> it should be "if (op_ret >= 0)", what do you think:

We don't pass the fd as the return value in open_cbk, that goes in the
fd_t. storage/posix returns 0 if an fd was successfully opened. 

So the current code is not incorrect. However, changing it to >= is a good idea,
making the code more defensive. 

Thanks for finding this!


More information about the Gluster-devel mailing list