[GEDI] gfapi: possible approaches to get lk_owner support

Soumya Koduri skoduri at redhat.com
Wed Oct 4 11:33:35 UTC 2017

Thank you all for your comments. Bases on your inputs, I did some POC on 
approach(3) i.e, to store lkowner in glfd itself. API syntax and sample 
test case are updated in [1]. Will refine the patch a bit more before 
calling for formal review. Please let me know if there are any objections.

> Jiffin's patch does a glfs_dup, if that creates a separate glfd that we
> can then set lock owner differently on, then it would work.

This seems to be a bit tricky. Each gfapi's glfd correspond to a unique 
fd on gluster server side. However if used glfs_dup, same server fd will 
be used for both those glfd objects but with extra reference taken.

As far as the locks are concerned, looks like when we close a fd, server 
expects us to pass on lkowner as well and it cleans up locks with only 
that lkowner. That way we are right now safe to use glfs_dup and set 
another lkowner on the duplicate glfd returned.

But if in case in future there comes any requirement to close all the 
locks tied to an fd, then the locks taken on both the glfd's shall be lost.


[1] https://review.gluster.org/18429

More information about the integration mailing list