In the main loop of nbd-client child, check_conn() will not return 0 when nbd
disconnected and parent exited during this loop. So the child has to
explicitly check parent identity and exit if parent exited.
The issue is easily reproduced by an immediate disconnect after a connect:
In the main loop of nbd-client child, check_conn() will not return 0 when nbd disconnected and parent exited during this loop. So the child has to explicitly check parent identity and exit if parent exited.
The issue is easily reproduced by an immediate disconnect after a connect:
nbd-client -N .... /dev/nbd0 && nbd-client -d /dev/nbd0
Then an nbd-client process may remain looping.