Description of problem: During data heal, we try to take locks on all the bricks, but we do not check for whether we got the lock on at least the source and one of the sink bricks before starting the heal. In function afr_selfheal_data_block(), we only check for the lock count to be equal to or greater than the number of sinks. There can be a case where we have 2 source bricks and one sink and the locking is successful on only the source brick(s). In this case we continue with the healing on sink without having a lock, which is not correct.
REVIEW: https://review.gluster.org/22349 (cluster/afr: Check for lock on source & sink before doing data heal) posted (#1) for review on master by Karthik U S
REVIEW: https://review.gluster.org/22349 (cluster/afr: Check for lock on source & sink before doing data heal) merged (#2) on master by Pranith Kumar Karampuri