From patchwork Mon Feb 11 05:57:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10805175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28DF013B5 for ; Mon, 11 Feb 2019 06:01:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EF8729B3E for ; Mon, 11 Feb 2019 06:01:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1E9829B42; Mon, 11 Feb 2019 06:01:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F68429B3E for ; Mon, 11 Feb 2019 06:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725962AbfBKF6m (ORCPT ); Mon, 11 Feb 2019 00:58:42 -0500 Received: from mout.gmx.net ([212.227.15.15]:46121 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbfBKF6m (ORCPT ); Mon, 11 Feb 2019 00:58:42 -0500 Received: from localhost.localdomain ([218.18.229.179]) by mail.gmx.com (mrgmx003 [212.227.17.184]) with ESMTPSA (Nemesis) id 0Lugbo-1h279X1wGW-00zonD; Mon, 11 Feb 2019 06:58:36 +0100 From: Chengguang Xu To: idryomov@gmail.com Cc: zyan@redhat.com, ceph-devel@vger.kernel.org, Chengguang Xu Subject: [PATCH] libceph: replace printk using pr_warn for warning message Date: Mon, 11 Feb 2019 13:57:56 +0800 Message-Id: <20190211055756.23251-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:t2YUFgKcY9FKeN8RMkK02S7rRzeXAxgXfuMBCSB/jvn3x9pjKRG 4qFkciyO++GalXTViXvSS5DzocOllB/XCeggMTW+FD8+yNZlkR5XllUEp6JIlH4yDLPuYdj OdFmXR1Ig+4sBGUIMxyG7XlLJZgad3Aam2O0e7PGkPrN20W/tZyCHiYm3rOrUCrKqM36n4l rfH66kxdUICc4A2iQl+Og== X-UI-Out-Filterresults: notjunk:1;V03:K0:VY/Y55NxliI=:RiZG6+tivSk4OG9BcobnoQ Rk0+x1BDOWANPCE2uVhbImQmgx80H19Gw4vgD2Tyi92BcUshHGt5NDxlga0fZQJrPqziXkP5p 7d9opN5z8pM0kWKueI5QCDk8x85atyRaHlSo60fevt2ZTIfgcEYUXT9mGjg64t26dw9MQ28W5 UcRIGJs1YVL/BGgnxQZhvAS4b7ex2+51ElfeoqYbRfCMEQZHDnvufLygfy177CrEYDEbbp3wk sM3eTPEdaSVoxXVZEkyYV8zyyNS7GBbWcH2KM0NCows4Gs+bNOg8fmtkf2gY6FRLY6Ufzs3q1 mIXOoON/4qlqkscLWtmkM65pMNPv9Nukt1ZxjAaG1UXJzd2Epd2A+HkaXg/zxn3k21a75rYpc iQr1n41oX1ZbD6Ea3KkXtXJf/XNX3Ju5GDMiwnF1j+WqhPE89ddSZfNP/1eRltStrlSb+mHeP sXj8rGCZWPlzP8e6kS4IJ/WL6EGyqX17JAruhUi7eE27GSx6lyj8GUpQI+4+7uc2tS4bZi/tB Sdx+Ir7fQWg0vSoVb02wxccKbiiEeU7u8mk/Pw5rMhZw/oJ+JYct6R3c76Bzq4vZkErAKU757 g8B1iAfR0QOFd4sbMVJKPEkF8MKPucepUwrCPasRUhD3G37IPVpJlfJjw4D6TRlNcL6q9ZjjS TISnshBmJ64QSOVpySI9pRLY9K+SuevzyIjiKqhqGyBcyOEOcS/k+YEnT6smhQ7xvsyOt/hAp OiOfKLtskXP2YrGypPmmOo4W611+j51iu/r8sKCe0ZlBaWhIDCe6lbe2QR3VE2IdgisZ28lx+ wBnKQrR3qYoNL3CD3hzQ8gCUQs0z2aZ3SpKszx4EvgAQcgfqv3Pzd3xE2c7TAqfMhlnbKEPjA elw1hNN+ldzHuG2+R3bhZLvKgh4wrqKmDKdSlvddV+XfWTSfvQ/+kHz0aS3zJz Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's better to print message on KERN_WARNING level in WARN_ON condition. Signed-off-by: Chengguang Xu --- 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); }