[Samba] renaming over to a busy file: traces

Michael Tokarev mjt at tls.msk.ru
Wed Mar 20 18:25:23 UTC 2024


20.03.2024 21:23, Ralph Boehme wrote:
> On 3/20/24 19:11, Michael Tokarev wrote:
>> 20.03.2024 20:18, Ralph Boehme via samba:
>>
>>> I guess the problem is that we can't lock two locking.tdb records simultaneously. We already have the source file record locked, also locking the 
>>> the destination record is not possible.
>>
>> Why it is not possible?
>>
>> Second lock can't be done in waiting mode, it can only be done
>> in lock-or-fail mode obviously (or else it is too prone to deadlocks).
> 
> it's prone to deadlock because another process could try to acquire the locks on the records in the reverse order.

Umh.  So what?

If the second lock (of either process) is of "lock-or-fail" kind
instead of "lock-or-wait", there would be no deadlocks.

/mjt




More information about the samba mailing list