mirror of
https://github.com/samba-team/samba.git
synced 2025-03-07 00:58:40 +03:00
ctdb-mutex: Test the lock by locking a 2nd byte range
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
97a1714ee9
commit
061315cc79
@ -265,6 +265,23 @@ static void lock_io_check_loop(struct tevent_req *subreq)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to lock a 2nd byte range. Using a blocking lock
|
||||
* encourages ping timeouts if the cluster filesystem is in a
|
||||
* bad state. It also makes testing easier.
|
||||
*/
|
||||
ret = fcntl_lock_fd(fd, true, 1);
|
||||
if (ret != 0) {
|
||||
fprintf(stderr,
|
||||
"%s: "
|
||||
"lock fail - lock file \"%s\" test lock error (%d)\n",
|
||||
progname,
|
||||
state->lock_file,
|
||||
ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Unlock occurs on close */
|
||||
close(fd);
|
||||
|
||||
subreq = tevent_wakeup_send(
|
||||
|
Loading…
x
Reference in New Issue
Block a user