flexnbd: Remove the server I/O lock from around NBD requests
NBD doesn't actually guarantee what happens if you have two concurrent writes to overlapping areas of the disc, and this mutex was causing us a near-deadlock when the TCP connection died uncleanly, partway through a request. So now we don't bother. This actually removes the last user of the server I/O mutex, so we can remove it completely from the codebase in a future commit.
This commit is contained in:
@@ -560,7 +560,6 @@ int client_serve_request(struct client* client)
|
|||||||
return client->disconnect;
|
return client->disconnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
server_lock_io( client->serve );
|
|
||||||
{
|
{
|
||||||
if ( !server_is_closed( client->serve ) ) {
|
if ( !server_is_closed( client->serve ) ) {
|
||||||
/* We arm / disarm around client_reply() to catch cases where the
|
/* We arm / disarm around client_reply() to catch cases where the
|
||||||
@@ -581,7 +580,6 @@ int client_serve_request(struct client* client)
|
|||||||
stop = 0;
|
stop = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server_unlock_io( client->serve );
|
|
||||||
|
|
||||||
|
|
||||||
return stop;
|
return stop;
|
||||||
@@ -616,7 +614,6 @@ void client_cleanup(struct client* client,
|
|||||||
client->fileno = -1;
|
client->fileno = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( server_io_locked( client->serve ) ) { server_unlock_io( client->serve ); }
|
|
||||||
if ( server_acl_locked( client->serve ) ) { server_unlock_acl( client->serve ); }
|
if ( server_acl_locked( client->serve ) ) { server_unlock_acl( client->serve ); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user