Skip to content

Commit f15abac

Browse files
q2venkawasaki
authored andcommitted
nbd: Remove redundant sock->ops->shutdown() check in nbd_get_socket().
Since commit 9f7c02e ("nbd: restrict sockets to TCP and UDP") (s/UDP/AF_UNIX/), NBD only accepts TCP and AF_UNIX SOCK_STREAM sockets as backend. nbd_get_socket() currently checks if sock->ops->shutdown() is sock_no_shutdown(), but sock->ops->shutdown() is always inet_shutdown() or unix_shutdown() for these socket types. Let's remove the redundant check. Signed-off-by: Kuniyuki Iwashima <[email protected]>
1 parent 359a150 commit f15abac

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

drivers/block/nbd.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,13 +1228,6 @@ static struct socket *nbd_get_socket(struct nbd_device *nbd, unsigned long fd,
12281228
return NULL;
12291229
}
12301230

1231-
if (sock->ops->shutdown == sock_no_shutdown) {
1232-
dev_err(disk_to_dev(nbd->disk), "Unsupported socket: shutdown callout must be supported.\n");
1233-
*err = -EINVAL;
1234-
sockfd_put(sock);
1235-
return NULL;
1236-
}
1237-
12381231
return sock;
12391232
}
12401233

0 commit comments

Comments
 (0)