aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/ceph_common.c11
-rw-r--r--net/ceph/debugfs.c2
-rw-r--r--net/ceph/messenger.c20
-rw-r--r--net/ceph/osd_client.c4
4 files changed, 25 insertions, 12 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 87afb9ec4c68..9cab80207ced 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -255,6 +255,7 @@ enum {
255 Opt_nocephx_sign_messages, 255 Opt_nocephx_sign_messages,
256 Opt_tcp_nodelay, 256 Opt_tcp_nodelay,
257 Opt_notcp_nodelay, 257 Opt_notcp_nodelay,
258 Opt_abort_on_full,
258}; 259};
259 260
260static match_table_t opt_tokens = { 261static match_table_t opt_tokens = {
@@ -280,6 +281,7 @@ static match_table_t opt_tokens = {
280 {Opt_nocephx_sign_messages, "nocephx_sign_messages"}, 281 {Opt_nocephx_sign_messages, "nocephx_sign_messages"},
281 {Opt_tcp_nodelay, "tcp_nodelay"}, 282 {Opt_tcp_nodelay, "tcp_nodelay"},
282 {Opt_notcp_nodelay, "notcp_nodelay"}, 283 {Opt_notcp_nodelay, "notcp_nodelay"},
284 {Opt_abort_on_full, "abort_on_full"},
283 {-1, NULL} 285 {-1, NULL}
284}; 286};
285 287
@@ -535,6 +537,10 @@ ceph_parse_options(char *options, const char *dev_name,
535 opt->flags &= ~CEPH_OPT_TCP_NODELAY; 537 opt->flags &= ~CEPH_OPT_TCP_NODELAY;
536 break; 538 break;
537 539
540 case Opt_abort_on_full:
541 opt->flags |= CEPH_OPT_ABORT_ON_FULL;
542 break;
543
538 default: 544 default:
539 BUG_ON(token); 545 BUG_ON(token);
540 } 546 }
@@ -549,7 +555,8 @@ out:
549} 555}
550EXPORT_SYMBOL(ceph_parse_options); 556EXPORT_SYMBOL(ceph_parse_options);
551 557
552int ceph_print_client_options(struct seq_file *m, struct ceph_client *client) 558int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
559 bool show_all)
553{ 560{
554 struct ceph_options *opt = client->options; 561 struct ceph_options *opt = client->options;
555 size_t pos = m->count; 562 size_t pos = m->count;
@@ -574,6 +581,8 @@ int ceph_print_client_options(struct seq_file *m, struct ceph_client *client)
574 seq_puts(m, "nocephx_sign_messages,"); 581 seq_puts(m, "nocephx_sign_messages,");
575 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0) 582 if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0)
576 seq_puts(m, "notcp_nodelay,"); 583 seq_puts(m, "notcp_nodelay,");
584 if (show_all && (opt->flags & CEPH_OPT_ABORT_ON_FULL))
585 seq_puts(m, "abort_on_full,");
577 586
578 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT) 587 if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT)
579 seq_printf(m, "mount_timeout=%d,", 588 seq_printf(m, "mount_timeout=%d,",
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c
index 02952605d121..46f65709a6ff 100644
--- a/net/ceph/debugfs.c
+++ b/net/ceph/debugfs.c
@@ -375,7 +375,7 @@ static int client_options_show(struct seq_file *s, void *p)
375 struct ceph_client *client = s->private; 375 struct ceph_client *client = s->private;
376 int ret; 376 int ret;
377 377
378 ret = ceph_print_client_options(s, client); 378 ret = ceph_print_client_options(s, client, true);
379 if (ret) 379 if (ret)
380 return ret; 380 return ret;
381 381
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d5718284db57..7e71b0df1fbc 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con)
2058 dout("process_connect on %p tag %d\n", con, (int)con->in_tag); 2058 dout("process_connect on %p tag %d\n", con, (int)con->in_tag);
2059 2059
2060 if (con->auth) { 2060 if (con->auth) {
2061 int len = le32_to_cpu(con->in_reply.authorizer_len);
2062
2061 /* 2063 /*
2062 * Any connection that defines ->get_authorizer() 2064 * Any connection that defines ->get_authorizer()
2063 * should also define ->add_authorizer_challenge() and 2065 * should also define ->add_authorizer_challenge() and
@@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con)
2067 */ 2069 */
2068 if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { 2070 if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) {
2069 ret = con->ops->add_authorizer_challenge( 2071 ret = con->ops->add_authorizer_challenge(
2070 con, con->auth->authorizer_reply_buf, 2072 con, con->auth->authorizer_reply_buf, len);
2071 le32_to_cpu(con->in_reply.authorizer_len));
2072 if (ret < 0) 2073 if (ret < 0)
2073 return ret; 2074 return ret;
2074 2075
@@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con)
2078 return 0; 2079 return 0;
2079 } 2080 }
2080 2081
2081 ret = con->ops->verify_authorizer_reply(con); 2082 if (len) {
2082 if (ret < 0) { 2083 ret = con->ops->verify_authorizer_reply(con);
2083 con->error_msg = "bad authorize reply"; 2084 if (ret < 0) {
2084 return ret; 2085 con->error_msg = "bad authorize reply";
2086 return ret;
2087 }
2085 } 2088 }
2086 } 2089 }
2087 2090
@@ -3206,9 +3209,10 @@ void ceph_con_keepalive(struct ceph_connection *con)
3206 dout("con_keepalive %p\n", con); 3209 dout("con_keepalive %p\n", con);
3207 mutex_lock(&con->mutex); 3210 mutex_lock(&con->mutex);
3208 clear_standby(con); 3211 clear_standby(con);
3212 con_flag_set(con, CON_FLAG_KEEPALIVE_PENDING);
3209 mutex_unlock(&con->mutex); 3213 mutex_unlock(&con->mutex);
3210 if (con_flag_test_and_set(con, CON_FLAG_KEEPALIVE_PENDING) == 0 && 3214
3211 con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0) 3215 if (con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0)
3212 queue_con(con); 3216 queue_con(con);
3213} 3217}
3214EXPORT_SYMBOL(ceph_con_keepalive); 3218EXPORT_SYMBOL(ceph_con_keepalive);
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index d23a9f81f3d7..fa9530dd876e 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -2315,7 +2315,7 @@ again:
2315 (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || 2315 (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) ||
2316 pool_full(osdc, req->r_t.base_oloc.pool))) { 2316 pool_full(osdc, req->r_t.base_oloc.pool))) {
2317 dout("req %p full/pool_full\n", req); 2317 dout("req %p full/pool_full\n", req);
2318 if (osdc->abort_on_full) { 2318 if (ceph_test_opt(osdc->client, ABORT_ON_FULL)) {
2319 err = -ENOSPC; 2319 err = -ENOSPC;
2320 } else { 2320 } else {
2321 pr_warn_ratelimited("FULL or reached pool quota\n"); 2321 pr_warn_ratelimited("FULL or reached pool quota\n");
@@ -2545,7 +2545,7 @@ static void ceph_osdc_abort_on_full(struct ceph_osd_client *osdc)
2545{ 2545{
2546 bool victims = false; 2546 bool victims = false;
2547 2547
2548 if (osdc->abort_on_full && 2548 if (ceph_test_opt(osdc->client, ABORT_ON_FULL) &&
2549 (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || have_pool_full(osdc))) 2549 (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || have_pool_full(osdc)))
2550 for_each_request(osdc, abort_on_full_fn, &victims); 2550 for_each_request(osdc, abort_on_full_fn, &victims);
2551} 2551}