[PATCH] avoid lock oder violation between xattr.tdb and g_lock.tdb

Steve French smfrench at gmail.com
Wed Jul 20 17:04:40 UTC 2016


On Tue, Jul 12, 2016 at 10:12 AM, Michael Adam <obnox at samba.org> wrote:
> On 2016-07-12 at 17:03 +0200, Volker Lendecke wrote:
>> On Tue, Jul 12, 2016 at 04:20:06PM +0200, Michael Adam wrote:
>> > Found by running selftest in my (wip) clustered member
>> > environment. xattr.tdb being of same lock-oder 2 as g_lock
>> > prevents fetch_locked->transaction on xattr.tdb in a
>> > clustered environment.
>> >
>> > Review appreciated.
>> >
>> > Cheers - Michael
>>
>> > From 9f9189c9eeecfb95804a1259fb9a097007068a29 Mon Sep 17 00:00:00 2001
>> > From: Michael Adam <obnox at samba.org>
>> > Date: Thu, 22 May 2014 11:45:12 +0200
>> > Subject: [PATCH] g_lock: avoid lock order violation with xattr_tdb
>> >
>> > Bump g_lock lock order to 3 from 2 to move it out
>> > of the way of xattr.tdb which also has lock-order 2.
>> > This way, we can do ctdb transactions on xattr.tdb.
>>
>> Not sure this will work. g_lock is a watched database, and if there is
>> lock contention, this will conflict with dbwrap_watchers.tdb.
>
> Ouch. So without the below-mentioned rework of dbwrap_watch
> (or another solution), we would need an additional lock oder
> value(4)?

This (Michael's) patch actually did work in our tests (ls -lR of large
directory cifs mount) avoided the lock order violation crash.

-- 
Thanks,

Steve



More information about the samba-technical mailing list