As per fcntl(3) man pages on receiving F_GETLK cmd, the filesystem is expected to get the first lock which blocks the lock description pointed to by the third argument to fcntl(). Prior to this fix, GlusterFS was not doing this.
smbtorture //server/share raw.ping-pong -U user%pass --option=torture:filename=file --option=torture:num_locks=N --option=torture:read=true --option=torture:write=true
server - Samba server
share - Samba share
user - Samba user (if needed)
pass - Samba user's password (if needed)
file - Junk file to which to write, preferably not yet extant
N - Number of instances of ping_pong that will be run + 1, or greater
The above test fails with with STATUS_FILE_LOCK_CONFLICT.
The fix ensures that we return the first lock that blocks the lock, that was supplied as an argument to fcntl(3).
The test mentioned in 'Consequence' section doesn't fail with STATUS_FILE_LOCK_CONFLICT.