Currently, flock structures are not being used properly. Correct their usage, by separating out the user supplied flock with the 'returned' flock structure. Test for fix: Patch1 * For F_SETLK type calls (cmd == F_SETLK) - All servers get the same flock structure. (verify using 'option trace on' in the locks xlator on server(s)) - Return flock does not matter. * For F_SETLKW type calls (cmd == F_SETLKW) SAME AS ABOVE * For F_UNLCK type calls (cmd == F_UNLCK) SAME AS ABOVE * For F_GETLK type calls (cmd == F_GETLK) - All servers should get the same flock structure - The returned flock should be the flock structure, where the lk call was successful: * If all fail, returned flock does not matter * Partial failure: returned flock from any server where flock was successful. Patch2 * Correct error messages in the log and failure of lk call (return value = -1 and errno = EINVAL) when flock is not filled properly: * Negative l_len values * Negative l_start values Will attach 2 c programs to verify the above.
PATCH: http://patches.gluster.com/patch/3513 in release-3.0 (cluster/afr: Return correct flock structures correctly in lk fops.)
PATCH: http://patches.gluster.com/patch/3514 in release-3.0 (features/locks: Check flock structure before proceeding with the lk call.)
PATCH: http://patches.gluster.com/patch/3522 in release-3.0 (write-behind: fixes in flush)
(In reply to comment #0) > Currently, flock structures are not being used properly. Correct their usage, > by separating out the user supplied flock with the 'returned' flock structure. > > Test for fix: > > Patch1 > > * For F_SETLK type calls (cmd == F_SETLK) > - All servers get the same flock structure. (verify using 'option trace on' > in the locks xlator on server(s)) > - Return flock does not matter. > * For F_SETLKW type calls (cmd == F_SETLKW) > SAME AS ABOVE > * For F_UNLCK type calls (cmd == F_UNLCK) > SAME AS ABOVE > > * For F_GETLK type calls (cmd == F_GETLK) > - All servers should get the same flock structure > - The returned flock should be the flock structure, where the lk call was > successful: > * If all fail, returned flock does not matter > * Partial failure: returned flock from any server where flock was > successful. > > > Patch2 > > * Correct error messages in the log and failure of lk call (return value = -1 > and errno = EINVAL) when flock is not filled properly: > * Negative l_len values > * Negative l_start values > > > Will attach 2 c programs to verify the above. where are the two "C" programs to be attached?
PATCH: http://patches.gluster.com/patch/4169 in master (cluster/afr: Return correct flock structures correctly in lk fops)
*** Bug 1039 has been marked as a duplicate of this bug. ***