From ef915c8eaf1d8335aa331d3b2376c40e3a63de22 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 1 Aug 2003 06:10:30 +0000 Subject: Final fix for the bug tridge found. Only push locks onto a blocking lock queue if the posix lock failed with EACCES or EAGAIN (this means another lock conflicts). Else return an error and don't queue the request. Jeremy. (This used to be commit 43fbc18fdc184bf29c15186c16bc99fb208de963) --- source3/locking/locking.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/locking') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index f4de83c346..4475f1446f 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -125,7 +125,11 @@ static NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_p */ if (!set_posix_lock(fsp, offset, count, lock_type)) { - status = NT_STATUS_LOCK_NOT_GRANTED; + if (errno == EACCES || errno == EAGAIN) + status = NT_STATUS_FILE_LOCK_CONFLICT; + else + status = map_nt_error_from_unix(errno); + /* * We failed to map - we must now remove the brl * lock entry. -- cgit