nbd icon indicating copy to clipboard operation
nbd copied to clipboard

Consumed connection cannot be reused after disconnect

Open Gnlfz007 opened this issue 4 years ago • 2 comments

On my NAS (Ubuntu-20.04), I defined a volume with option "maxconnections=1, as a workaround for exclusive volume export. This way I want to ensure that my Laptop and my PC do not corrupt a LUKS/ext4 volume accidentally via concurrent mount.

[vol-test]
exportname=/dat/nbd-export/vol-test
maxconnections=1

On the client, the following commands result in an unexpected error message:

> sudo nbd-client my_nas -N vol-test /dev/nbd0
Negotiation: ..size = 1024MB
Connected /dev/nbd0
> sudo nbd-client -d /dev/nbd0
> sudo nbd-client my_nas -N vol-test /dev/nbd0
Negotiation: ..Error: Connection not allowed by server policy. Server said: Access denied by server configurationguration for th�
Exiting.

The only cure I know is systemctl restart nbd-server on the server. Is this an expected behavior, or rather a bug?

Gnlfz007 avatar Sep 06 '21 06:09 Gnlfz007

I'm still on Ubuntu 20.04 / kernel 5.4.0-146-generic #163-Ubuntu SMP and the issue persists. Each connection is consumed forever, even if the client disconnects orderly (-disconnect). Is this actually the expected behavior? Any new related to this issue?

Gnlfz007 avatar May 18 '23 18:05 Gnlfz007