It's better to print message on KERN_WARNING level in WARN_ON condition. Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> --- net/ceph/messenger.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 3661cdd927f1..029fdc5b3a35 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -302,7 +302,7 @@ static void con_sock_state_init(struct ceph_connection *con) old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CLOSED); if (WARN_ON(old_state != CON_SOCK_STATE_NEW)) - printk("%s: unexpected old state %d\n", __func__, old_state); + pr_warn("%s: unexpected old state %d\n", __func__, old_state); dout("%s con %p sock %d -> %d\n", __func__, con, old_state, CON_SOCK_STATE_CLOSED); } @@ -313,7 +313,7 @@ static void con_sock_state_connecting(struct ceph_connection *con) old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CONNECTING); if (WARN_ON(old_state != CON_SOCK_STATE_CLOSED)) - printk("%s: unexpected old state %d\n", __func__, old_state); + pr_warn("%s: unexpected old state %d\n", __func__, old_state); dout("%s con %p sock %d -> %d\n", __func__, con, old_state, CON_SOCK_STATE_CONNECTING); } @@ -324,7 +324,7 @@ static void con_sock_state_connected(struct ceph_connection *con) old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CONNECTED); if (WARN_ON(old_state != CON_SOCK_STATE_CONNECTING)) - printk("%s: unexpected old state %d\n", __func__, old_state); + pr_warn("%s: unexpected old state %d\n", __func__, old_state); dout("%s con %p sock %d -> %d\n", __func__, con, old_state, CON_SOCK_STATE_CONNECTED); } @@ -337,7 +337,7 @@ static void con_sock_state_closing(struct ceph_connection *con) if (WARN_ON(old_state != CON_SOCK_STATE_CONNECTING && old_state != CON_SOCK_STATE_CONNECTED && old_state != CON_SOCK_STATE_CLOSING)) - printk("%s: unexpected old state %d\n", __func__, old_state); + pr_warn("%s: unexpected old state %d\n", __func__, old_state); dout("%s con %p sock %d -> %d\n", __func__, con, old_state, CON_SOCK_STATE_CLOSING); } @@ -351,7 +351,7 @@ static void con_sock_state_closed(struct ceph_connection *con) old_state != CON_SOCK_STATE_CLOSING && old_state != CON_SOCK_STATE_CONNECTING && old_state != CON_SOCK_STATE_CLOSED)) - printk("%s: unexpected old state %d\n", __func__, old_state); + pr_warn("%s: unexpected old state %d\n", __func__, old_state); dout("%s con %p sock %d -> %d\n", __func__, con, old_state, CON_SOCK_STATE_CLOSED); } -- 2.20.1