aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-08-09 18:03:46 -0400
committerSage Weil <sage@newdream.net>2011-10-25 19:10:15 -0400
commitb61c27636fffbaf1980e675282777b9467254a40 (patch)
treebd78cfefda4beb7e3de5fe97dd36fed3dbfa91c1 /net/ceph/messenger.c
parentf6a2f5be07463ef532b9f4e3cb9e42ab9df85832 (diff)
libceph: don't complain on msgpool alloc failures
The pool allocation failures are masked by the pool; there is no need to spam the console about them. (That's the whole point of having the pool in the first place.) Mark msg allocations whose failure is safely handled as such. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 9918e9eb276e..2de711a0c037 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2281,7 +2281,8 @@ EXPORT_SYMBOL(ceph_con_keepalive);
2281 * construct a new message with given type, size 2281 * construct a new message with given type, size
2282 * the new msg has a ref count of 1. 2282 * the new msg has a ref count of 1.
2283 */ 2283 */
2284struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags) 2284struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
2285 bool can_fail)
2285{ 2286{
2286 struct ceph_msg *m; 2287 struct ceph_msg *m;
2287 2288
@@ -2333,7 +2334,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
2333 m->front.iov_base = kmalloc(front_len, flags); 2334 m->front.iov_base = kmalloc(front_len, flags);
2334 } 2335 }
2335 if (m->front.iov_base == NULL) { 2336 if (m->front.iov_base == NULL) {
2336 pr_err("msg_new can't allocate %d bytes\n", 2337 dout("ceph_msg_new can't allocate %d bytes\n",
2337 front_len); 2338 front_len);
2338 goto out2; 2339 goto out2;
2339 } 2340 }
@@ -2348,7 +2349,13 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
2348out2: 2349out2:
2349 ceph_msg_put(m); 2350 ceph_msg_put(m);
2350out: 2351out:
2351 pr_err("msg_new can't create type %d front %d\n", type, front_len); 2352 if (!can_fail) {
2353 pr_err("msg_new can't create type %d front %d\n", type,
2354 front_len);
2355 } else {
2356 dout("msg_new can't create type %d front %d\n", type,
2357 front_len);
2358 }
2352 return NULL; 2359 return NULL;
2353} 2360}
2354EXPORT_SYMBOL(ceph_msg_new); 2361EXPORT_SYMBOL(ceph_msg_new);
@@ -2398,7 +2405,7 @@ static struct ceph_msg *ceph_alloc_msg(struct ceph_connection *con,
2398 } 2405 }
2399 if (!msg) { 2406 if (!msg) {
2400 *skip = 0; 2407 *skip = 0;
2401 msg = ceph_msg_new(type, front_len, GFP_NOFS); 2408 msg = ceph_msg_new(type, front_len, GFP_NOFS, false);
2402 if (!msg) { 2409 if (!msg) {
2403 pr_err("unable to allocate msg type %d len %d\n", 2410 pr_err("unable to allocate msg type %d len %d\n",
2404 type, front_len); 2411 type, front_len);