Skip to contentSkip to conversation

FAILED: patch "[PATCH] nbd: stop leaking sockets" failed to apply to 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 12, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 6a8a21546507a3ec88e81c2ec927a3fb63efa8ff Mon Sep 17 00:00:00 2001

From: Josef Bacik <[email protected]>
Date: Wed, 1 Mar 2017 11:47:22 -0500
Subject: [PATCH] nbd: stop leaking sockets

This was introduced in the multi-connection patch, we've been leaking socket's ever since.

Fixes 9561a7a ("nbd: add multi-connection support")
drivers/block/nbd.c +3 -1
index 0bf2b21a62cb..c7e93f62366f 100644
@@ -689,8 +689,10 @@ static int nbd_clear_sock(struct nbd_device *nbd, struct block_device *bdev)
 	    nbd->num_connections) {
 		int i;
 
-		for (i = 0; i < nbd->num_connections; i++)
+		for (i = 0; i < nbd->num_connections; i++) {
+			sockfd_put(nbd->socks[i]->sock);
 			kfree(nbd->socks[i]);
+		}
 		kfree(nbd->socks);
 		nbd->socks = NULL;
 		nbd->num_connections = 0;