NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
450 stars 116 forks source link

Consumed connection cannot be reused after disconnect #126

Open Gnlfz007 opened 3 years ago

Gnlfz007 commented 3 years ago

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 commented 1 year ago

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?