[PATCH] reduce fd usage in smbd

Dan Sledz dan.sledz at isilon.com
Wed Feb 25 00:39:37 MST 2009


On Feb 24, 2009, at 11:31 PM, Stefan (metze) Metzmacher wrote:

> Andrew Bartlett schrieb:
>> On Tue, 2009-02-24 at 18:23 -0800, Dan Sledz wrote:
>>>> From the patch description:
>>>
>>>
>>>
>>> It seems we are calling tdb_reopen_all for two reasons:
>>>
>>> The first reason is to make sure we get a new seek pointer.
>>> The second reason has to do with the TDB_CLEAR_IF_FIRST flag.
>>
>> Surely there are also locking interactions here?
>>
>> All I know is that POSIX locking is insane, and I wouldn't want to
>> change this without considering this in particular.
>
> If there're no locking issues I would propose this:
> http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=7648b8f94c0709f39b873b872bc1273a6568ad3b
>
> It makes tdb_reopen_all() a noop.

Posix locks are per process, whole file locks (via flock) are per fd.   
Plus it appears it's illegal to call tdb_reopen while holding a lock.   
I also like metze's patch better. 


More information about the samba-technical mailing list