forked from vitalif/vitastor
Disconnect NBD proxy correctly without leaving a zombie [vitastor-nbd] process in D state
parent
39531ef1a6
commit
cd18ef7323
|
@ -705,6 +705,12 @@ protected:
|
|||
if (read_state == CL_READ_HDR)
|
||||
{
|
||||
int req_type = be32toh(cur_req.type);
|
||||
if (be32toh(cur_req.magic) == NBD_REQUEST_MAGIC && req_type == NBD_CMD_DISC)
|
||||
{
|
||||
// Disconnect
|
||||
close(nbd_fd);
|
||||
exit(0);
|
||||
}
|
||||
if (be32toh(cur_req.magic) != NBD_REQUEST_MAGIC ||
|
||||
req_type != NBD_CMD_READ && req_type != NBD_CMD_WRITE && req_type != NBD_CMD_FLUSH)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue