From 9a3106f9463cddffb8dd7cc9f7d4d72fbdc36e7c Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 23 Sep 2013 10:22:48 +0100 Subject: [PATCH] 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. --- src/client.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/client.c b/src/client.c index da26c28..406438b 100644 --- a/src/client.c +++ b/src/client.c @@ -560,7 +560,6 @@ int client_serve_request(struct client* client) return client->disconnect; } - server_lock_io( client->serve ); { if ( !server_is_closed( client->serve ) ) { /* We arm / disarm around client_reply() to catch cases where the @@ -581,7 +580,6 @@ int client_serve_request(struct client* client) stop = 0; } } - server_unlock_io( client->serve ); return stop; @@ -616,7 +614,6 @@ void client_cleanup(struct client* client, 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 ); } }