[PATCHES] smbcontrol disconnect-client
cs at samba.org
Wed Dec 11 11:15:10 MST 2013
On Wed, Dec 11, 2013 at 06:48:00PM +0100, Stefan (metze) Metzmacher wrote:
> Am 11.12.2013 02:24, schrieb Jeremy Allison:
> > On Sat, Dec 07, 2013 at 01:05:58PM +0100, Stefan (metze) Metzmacher wrote:
> >> Am 07.12.2013 00:15, schrieb Christof Schmitt:
> >>> Here are a few patches that Christian had developed some time ago. They
> >>> implement a 'smbcontrol disconnect-client <ip address>' call that
> >>> disconnects all clients from a certain IP address. That is useful when a
> >>> config file for a specific client has been changed and that change has
> >>> to be enforced.
> >>> Comments?
> >> I think this is too dangerous, if the client still has files with
> >> batch/exclusive oplocks
> >> open and changes in the local buffer, we may trigger data corruption. At
> >> least without
> >> durable opens.
> >> I think the command (maybe a 2nd one) should first trigger a break to
> >> level2 to all opens
> >> and don't grant more for the rest of the connection lifetime. And the
> >> disconnect
> >> should only work if the connection is in good shape.
> > That's a good enhancement (make the command trigger a
> > break first). However this is a "be careful what you
> > wish for" command - people have been asking for a
> > way to forcibly disconnect a specific client for
> > quite a long time.
> > Maybe it should be renamed "smbcontrol force-disconnect-client"
> > or "smbcontrol disconnect-client-with-extreme-prejudice"
> > command ?
> Maybe "smbcontrol kill-client-connections" ?
Changing the name is easy. :-)
I took a look at the suggestions and it should not be too difficult to
implement a call that revokes all oplocks. So we could have two calls to
disconnect a client:
1) smbcontrol kill-client-connections:
- Just exit the server.
2) smbcontrol drop-client-connections:
- Set a flag to no longer grant exclusive oplocks
- Send a break for all exclusive oplocks
- When oplocks.exclusive_open is zero, then exit.
This should always work, since oplocks are considered broken after
What is the best way forward here? Rename the control to
kill-client-connections and push the patches? And then start working on
the second command?
More information about the samba-technical