aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-09 16:13:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-09 16:13:11 -0400
commit4c0a9f7458dabf2b8cb9987c863e335480a22b67 (patch)
tree416266b3e63a89a81f4b43b49d75a91f7a5ac5d4
parent9abea2d64ce93b6909de7f83a7f681f572369708 (diff)
parent6e67b7ae2157bdeb6b56381e530fc74bb68b6149 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull Ceph fixes from Sage Weil: "There is a fix for CephFS and RBD when used within containers/namespaces, and a fix for the address learning the client is supposed to do when initially talking to the Ceph cluster. There are also two patches updating MAINTAINERS. One breaks out the common Ceph code shared by fs/ceph and drivers/block/rbd.c into a separate entry with the appropriate maintainers listed. The second adds a second reference to the github tree where the Ceph client development takes place (before it is pushed to korg and then to you). The goal here is to move closer to a situation where Ilya Dryomov or one of the other maintainers can push things to you if I am unavailable. Ilya has done most of the work preparing branches for upstream recently; you should not be surprised to hear from him if I am trapped in some internet-less wasteland or hit by a bus or something. In the meantime, we'll work on getting him added to the kernel web of trust" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: MAINTAINERS: add secondary tree for ceph modules MAINTAINERS: update ceph entries libceph: treat sockaddr_storage with uninitialized family as blank libceph: enable ceph in a non-default network namespace
-rw-r--r--MAINTAINERS22
-rw-r--r--include/linux/ceph/messenger.h3
-rw-r--r--net/ceph/ceph_common.c16
-rw-r--r--net/ceph/messenger.c24
4 files changed, 47 insertions, 18 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 8133cefb6b6e..0d70760e8135 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2562,19 +2562,31 @@ F: arch/powerpc/include/uapi/asm/spu*.h
2562F: arch/powerpc/oprofile/*cell* 2562F: arch/powerpc/oprofile/*cell*
2563F: arch/powerpc/platforms/cell/ 2563F: arch/powerpc/platforms/cell/
2564 2564
2565CEPH DISTRIBUTED FILE SYSTEM CLIENT 2565CEPH COMMON CODE (LIBCEPH)
2566M: Ilya Dryomov <idryomov@gmail.com>
2566M: "Yan, Zheng" <zyan@redhat.com> 2567M: "Yan, Zheng" <zyan@redhat.com>
2567M: Sage Weil <sage@redhat.com> 2568M: Sage Weil <sage@redhat.com>
2568L: ceph-devel@vger.kernel.org 2569L: ceph-devel@vger.kernel.org
2569W: http://ceph.com/ 2570W: http://ceph.com/
2570T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git 2571T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
2572T: git git://github.com/ceph/ceph-client.git
2571S: Supported 2573S: Supported
2572F: Documentation/filesystems/ceph.txt
2573F: fs/ceph/
2574F: net/ceph/ 2574F: net/ceph/
2575F: include/linux/ceph/ 2575F: include/linux/ceph/
2576F: include/linux/crush/ 2576F: include/linux/crush/
2577 2577
2578CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)
2579M: "Yan, Zheng" <zyan@redhat.com>
2580M: Sage Weil <sage@redhat.com>
2581M: Ilya Dryomov <idryomov@gmail.com>
2582L: ceph-devel@vger.kernel.org
2583W: http://ceph.com/
2584T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
2585T: git git://github.com/ceph/ceph-client.git
2586S: Supported
2587F: Documentation/filesystems/ceph.txt
2588F: fs/ceph/
2589
2578CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: 2590CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
2579L: linux-usb@vger.kernel.org 2591L: linux-usb@vger.kernel.org
2580S: Orphan 2592S: Orphan
@@ -8366,10 +8378,12 @@ RADOS BLOCK DEVICE (RBD)
8366M: Ilya Dryomov <idryomov@gmail.com> 8378M: Ilya Dryomov <idryomov@gmail.com>
8367M: Sage Weil <sage@redhat.com> 8379M: Sage Weil <sage@redhat.com>
8368M: Alex Elder <elder@kernel.org> 8380M: Alex Elder <elder@kernel.org>
8369M: ceph-devel@vger.kernel.org 8381L: ceph-devel@vger.kernel.org
8370W: http://ceph.com/ 8382W: http://ceph.com/
8371T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git 8383T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
8384T: git git://github.com/ceph/ceph-client.git
8372S: Supported 8385S: Supported
8386F: Documentation/ABI/testing/sysfs-bus-rbd
8373F: drivers/block/rbd.c 8387F: drivers/block/rbd.c
8374F: drivers/block/rbd_types.h 8388F: drivers/block/rbd_types.h
8375 8389
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index e15499422fdc..37753278987a 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -8,6 +8,7 @@
8#include <linux/radix-tree.h> 8#include <linux/radix-tree.h>
9#include <linux/uio.h> 9#include <linux/uio.h>
10#include <linux/workqueue.h> 10#include <linux/workqueue.h>
11#include <net/net_namespace.h>
11 12
12#include <linux/ceph/types.h> 13#include <linux/ceph/types.h>
13#include <linux/ceph/buffer.h> 14#include <linux/ceph/buffer.h>
@@ -56,6 +57,7 @@ struct ceph_messenger {
56 struct ceph_entity_addr my_enc_addr; 57 struct ceph_entity_addr my_enc_addr;
57 58
58 atomic_t stopping; 59 atomic_t stopping;
60 possible_net_t net;
59 bool nocrc; 61 bool nocrc;
60 bool tcp_nodelay; 62 bool tcp_nodelay;
61 63
@@ -267,6 +269,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr,
267 u64 required_features, 269 u64 required_features,
268 bool nocrc, 270 bool nocrc,
269 bool tcp_nodelay); 271 bool tcp_nodelay);
272extern void ceph_messenger_fini(struct ceph_messenger *msgr);
270 273
271extern void ceph_con_init(struct ceph_connection *con, void *private, 274extern void ceph_con_init(struct ceph_connection *con, void *private,
272 const struct ceph_connection_operations *ops, 275 const struct ceph_connection_operations *ops,
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index cb7db320dd27..f30329f72641 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -9,6 +9,7 @@
9#include <keys/ceph-type.h> 9#include <keys/ceph-type.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/mount.h> 11#include <linux/mount.h>
12#include <linux/nsproxy.h>
12#include <linux/parser.h> 13#include <linux/parser.h>
13#include <linux/sched.h> 14#include <linux/sched.h>
14#include <linux/seq_file.h> 15#include <linux/seq_file.h>
@@ -16,8 +17,6 @@
16#include <linux/statfs.h> 17#include <linux/statfs.h>
17#include <linux/string.h> 18#include <linux/string.h>
18#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
19#include <linux/nsproxy.h>
20#include <net/net_namespace.h>
21 20
22 21
23#include <linux/ceph/ceph_features.h> 22#include <linux/ceph/ceph_features.h>
@@ -131,6 +130,13 @@ int ceph_compare_options(struct ceph_options *new_opt,
131 int i; 130 int i;
132 int ret; 131 int ret;
133 132
133 /*
134 * Don't bother comparing options if network namespaces don't
135 * match.
136 */
137 if (!net_eq(current->nsproxy->net_ns, read_pnet(&client->msgr.net)))
138 return -1;
139
134 ret = memcmp(opt1, opt2, ofs); 140 ret = memcmp(opt1, opt2, ofs);
135 if (ret) 141 if (ret)
136 return ret; 142 return ret;
@@ -335,9 +341,6 @@ ceph_parse_options(char *options, const char *dev_name,
335 int err = -ENOMEM; 341 int err = -ENOMEM;
336 substring_t argstr[MAX_OPT_ARGS]; 342 substring_t argstr[MAX_OPT_ARGS];
337 343
338 if (current->nsproxy->net_ns != &init_net)
339 return ERR_PTR(-EINVAL);
340
341 opt = kzalloc(sizeof(*opt), GFP_KERNEL); 344 opt = kzalloc(sizeof(*opt), GFP_KERNEL);
342 if (!opt) 345 if (!opt)
343 return ERR_PTR(-ENOMEM); 346 return ERR_PTR(-ENOMEM);
@@ -608,6 +611,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
608fail_monc: 611fail_monc:
609 ceph_monc_stop(&client->monc); 612 ceph_monc_stop(&client->monc);
610fail: 613fail:
614 ceph_messenger_fini(&client->msgr);
611 kfree(client); 615 kfree(client);
612 return ERR_PTR(err); 616 return ERR_PTR(err);
613} 617}
@@ -621,8 +625,8 @@ void ceph_destroy_client(struct ceph_client *client)
621 625
622 /* unmount */ 626 /* unmount */
623 ceph_osdc_stop(&client->osdc); 627 ceph_osdc_stop(&client->osdc);
624
625 ceph_monc_stop(&client->monc); 628 ceph_monc_stop(&client->monc);
629 ceph_messenger_fini(&client->msgr);
626 630
627 ceph_debugfs_client_cleanup(client); 631 ceph_debugfs_client_cleanup(client);
628 632
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 1679f47280e2..e3be1d22a247 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -6,6 +6,7 @@
6#include <linux/inet.h> 6#include <linux/inet.h>
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/slab.h> 10#include <linux/slab.h>
10#include <linux/socket.h> 11#include <linux/socket.h>
11#include <linux/string.h> 12#include <linux/string.h>
@@ -479,7 +480,7 @@ static int ceph_tcp_connect(struct ceph_connection *con)
479 int ret; 480 int ret;
480 481
481 BUG_ON(con->sock); 482 BUG_ON(con->sock);
482 ret = sock_create_kern(&init_net, con->peer_addr.in_addr.ss_family, 483 ret = sock_create_kern(read_pnet(&con->msgr->net), paddr->ss_family,
483 SOCK_STREAM, IPPROTO_TCP, &sock); 484 SOCK_STREAM, IPPROTO_TCP, &sock);
484 if (ret) 485 if (ret)
485 return ret; 486 return ret;
@@ -1731,17 +1732,17 @@ static int verify_hello(struct ceph_connection *con)
1731 1732
1732static bool addr_is_blank(struct sockaddr_storage *ss) 1733static bool addr_is_blank(struct sockaddr_storage *ss)
1733{ 1734{
1735 struct in_addr *addr = &((struct sockaddr_in *)ss)->sin_addr;
1736 struct in6_addr *addr6 = &((struct sockaddr_in6 *)ss)->sin6_addr;
1737
1734 switch (ss->ss_family) { 1738 switch (ss->ss_family) {
1735 case AF_INET: 1739 case AF_INET:
1736 return ((struct sockaddr_in *)ss)->sin_addr.s_addr == 0; 1740 return addr->s_addr == htonl(INADDR_ANY);
1737 case AF_INET6: 1741 case AF_INET6:
1738 return 1742 return ipv6_addr_any(addr6);
1739 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[0] == 0 && 1743 default:
1740 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[1] == 0 && 1744 return true;
1741 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[2] == 0 &&
1742 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[3] == 0;
1743 } 1745 }
1744 return false;
1745} 1746}
1746 1747
1747static int addr_port(struct sockaddr_storage *ss) 1748static int addr_port(struct sockaddr_storage *ss)
@@ -2944,11 +2945,18 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
2944 msgr->tcp_nodelay = tcp_nodelay; 2945 msgr->tcp_nodelay = tcp_nodelay;
2945 2946
2946 atomic_set(&msgr->stopping, 0); 2947 atomic_set(&msgr->stopping, 0);
2948 write_pnet(&msgr->net, get_net(current->nsproxy->net_ns));
2947 2949
2948 dout("%s %p\n", __func__, msgr); 2950 dout("%s %p\n", __func__, msgr);
2949} 2951}
2950EXPORT_SYMBOL(ceph_messenger_init); 2952EXPORT_SYMBOL(ceph_messenger_init);
2951 2953
2954void ceph_messenger_fini(struct ceph_messenger *msgr)
2955{
2956 put_net(read_pnet(&msgr->net));
2957}
2958EXPORT_SYMBOL(ceph_messenger_fini);
2959
2952static void clear_standby(struct ceph_connection *con) 2960static void clear_standby(struct ceph_connection *con)
2953{ 2961{
2954 /* come back from STANDBY? */ 2962 /* come back from STANDBY? */