diff options
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index b8d927c56494..a6b2f2138c9d 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/kthread.h> | 7 | #include <linux/kthread.h> |
8 | #include <linux/net.h> | 8 | #include <linux/net.h> |
9 | #include <linux/nsproxy.h> | 9 | #include <linux/nsproxy.h> |
10 | #include <linux/sched.h> | ||
10 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
11 | #include <linux/socket.h> | 12 | #include <linux/socket.h> |
12 | #include <linux/string.h> | 13 | #include <linux/string.h> |
@@ -478,11 +479,16 @@ static int ceph_tcp_connect(struct ceph_connection *con) | |||
478 | { | 479 | { |
479 | struct sockaddr_storage *paddr = &con->peer_addr.in_addr; | 480 | struct sockaddr_storage *paddr = &con->peer_addr.in_addr; |
480 | struct socket *sock; | 481 | struct socket *sock; |
482 | unsigned int noio_flag; | ||
481 | int ret; | 483 | int ret; |
482 | 484 | ||
483 | BUG_ON(con->sock); | 485 | BUG_ON(con->sock); |
486 | |||
487 | /* sock_create_kern() allocates with GFP_KERNEL */ | ||
488 | noio_flag = memalloc_noio_save(); | ||
484 | ret = sock_create_kern(read_pnet(&con->msgr->net), paddr->ss_family, | 489 | ret = sock_create_kern(read_pnet(&con->msgr->net), paddr->ss_family, |
485 | SOCK_STREAM, IPPROTO_TCP, &sock); | 490 | SOCK_STREAM, IPPROTO_TCP, &sock); |
491 | memalloc_noio_restore(noio_flag); | ||
486 | if (ret) | 492 | if (ret) |
487 | return ret; | 493 | return ret; |
488 | sock->sk->sk_allocation = GFP_NOFS; | 494 | sock->sk->sk_allocation = GFP_NOFS; |