From patchwork Thu Apr 12 09:21:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinpu Wang X-Patchwork-Id: 10338075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED93260134 for ; Thu, 12 Apr 2018 09:22:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6D1A28700 for ; Thu, 12 Apr 2018 09:22:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB6F32872C; Thu, 12 Apr 2018 09:22:01 +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,DKIM_SIGNED, DKIM_VALID, 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 2247328700 for ; Thu, 12 Apr 2018 09:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbeDLJWA (ORCPT ); Thu, 12 Apr 2018 05:22:00 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36876 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbeDLJV7 (ORCPT ); Thu, 12 Apr 2018 05:21:59 -0400 Received: by mail-wm0-f68.google.com with SMTP id l16so4644436wmh.2 for ; Thu, 12 Apr 2018 02:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=iHJhKmGQqCai2aXcZ4aOCA0kmVef8wBEFj+cwGJWIrI=; b=zXTWTjNBqpvkkCXDY8qLZZMMty/TiyStvMCCgGv7NlFFWU/rd29ukl6gN3bgZtZhnV kXjWsH9sOe9Y3JnEwWDVUzbugYKWUuxyeAufzxcBQ9/6Yf1jfTWenLTbEdfjNN7+2B+U 0mlSrEozx36aCWzkPx0gfHYk8X4traXnIc4pdPSTGyAmJ7h9u4f5S+8I9IFef+ax7Rtu wN7FQhpfWMEKRNRRQ6Cc2C09PaoQLtVb0XWMtCIAQHrpdPB/TqHJTEHIQ+pIAa8fK49c 3c/R/CP3ASx8uLsD7A0KXQ0hQquyus7QF+BBSsrVgkZvnW3hgwzyM+W4CAdzPB4yibbJ 00Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iHJhKmGQqCai2aXcZ4aOCA0kmVef8wBEFj+cwGJWIrI=; b=gRhOfomA2VE4JBPvt9FFzv4Ltl1nvA5QNFLcoDH6Tzl1+3AIKmpB2winqO03vt53MD /AVjy2MM1B4h3f8eUoeRsOCak3hurTUlz3tSXJUCGRoDt7pp+uRGxs3qRdrbkjYirucv U0iN6iRZAc9WkTMoZtRwOwN30stxtQCc7+b+hwSR4OkJqHlf5WbX+LbuFuDl9OZlelxj 57s2ViKXZL0pT704zvG+H1OLisfeNuT9kI/mc+3Gx9eQoAmXgLpTumuGBmuf6OQQ9BP2 xLrLvCfrXWWvUacLz78KqxMqBeH1NKU4ScGmigNwHqunZ3+MF5B5WqIiObhRCprKg3Kh pTgQ== X-Gm-Message-State: ALQs6tA0oS3fC6Xhei404mXEUPCzK37UgUQUkBgvFvzEiWavpkVvZzos 8RKenRTcdQGib3M6ipuHnBr2HfA8 X-Google-Smtp-Source: AIpwx48BQZV+NLW0HZJz+tihVHOcorHG7OoMuePflSqmzWwRtNJZ1bTnmrLxvOXQ8UgPJUruozmtqg== X-Received: by 10.28.107.151 with SMTP id a23mr98093wmi.14.1523524918011; Thu, 12 Apr 2018 02:21:58 -0700 (PDT) Received: from jinpu-GA-870A-USB3.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id s49sm4308518wrc.36.2018.04.12.02.21.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Apr 2018 02:21:56 -0700 (PDT) From: Jack Wang X-Google-Original-From: Jack Wang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, elliott@hpe.com, Jack Wang Subject: [PATCH v2] block: ratelimite pr_err on IO path Date: Thu, 12 Apr 2018 11:21:55 +0200 Message-Id: <1523524915-25170-1-git-send-email-jinpu.wangl@profitbricks.com> X-Mailer: git-send-email 2.7.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jack Wang This avoid soft lockup below: [ 2328.328429] Call Trace: [ 2328.328433] vprintk_emit+0x229/0x2e0 [ 2328.328436] ? t10_pi_type3_verify_ip+0x20/0x20 [ 2328.328437] printk+0x52/0x6e [ 2328.328439] t10_pi_verify+0x9e/0xf0 [ 2328.328441] bio_integrity_process+0x12e/0x220 [ 2328.328442] ? t10_pi_type1_verify_crc+0x20/0x20 [ 2328.328443] bio_integrity_verify_fn+0xde/0x140 [ 2328.328447] process_one_work+0x13f/0x370 [ 2328.328449] worker_thread+0x62/0x3d0 [ 2328.328450] ? rescuer_thread+0x2f0/0x2f0 [ 2328.328452] kthread+0x116/0x150 [ 2328.328454] ? __kthread_parkme+0x70/0x70 [ 2328.328457] ret_from_fork+0x35/0x40 Signed-off-by: Jack Wang --- v2: keep the message in same line as Robert and coding style suggested block/t10-pi.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index a98db38..6faf8c1 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -84,10 +84,11 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, if (be32_to_cpu(pi->ref_tag) != lower_32_bits(iter->seed)) { - pr_err("%s: ref tag error at location %llu " \ - "(rcvd %u)\n", iter->disk_name, - (unsigned long long) - iter->seed, be32_to_cpu(pi->ref_tag)); + pr_err_ratelimited("%s: ref tag error at location %llu (rcvd %u)\n", + iter->disk_name, + (unsigned long long) + iter->seed, + be32_to_cpu(pi->ref_tag)); return BLK_STS_PROTECTION; } break; @@ -101,10 +102,11 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, csum = fn(iter->data_buf, iter->interval); if (pi->guard_tag != csum) { - pr_err("%s: guard tag error at sector %llu " \ - "(rcvd %04x, want %04x)\n", iter->disk_name, - (unsigned long long)iter->seed, - be16_to_cpu(pi->guard_tag), be16_to_cpu(csum)); + pr_err_ratelimited("%s: guard tag error at sector %llu (rcvd %04x, want %04x)\n", + iter->disk_name, + (unsigned long long)iter->seed, + be16_to_cpu(pi->guard_tag), + be16_to_cpu(csum)); return BLK_STS_PROTECTION; }