Received: by 10.192.165.156 with SMTP id m28csp1728882imm; Thu, 12 Apr 2018 02:26:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx49D7/niCYBIehXzdu1astaJMhLPJOxSZojgRfgUtRBnRiB9xorIj3uEQq5rrCg2a44R91+g X-Received: by 10.98.144.85 with SMTP id a82mr1061154pfe.14.1523525168514; Thu, 12 Apr 2018 02:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523525168; cv=none; d=google.com; s=arc-20160816; b=zz3IzLHlwAXeyGICka9YOFPHnWrAIaUMI897D0BPrwRFdvZhGfXc3DgzlIpYsgYY92 sejbHzrY3WYjguX8BOF1ZT/3CXao0J/BkSexSBqmnKUZFnWmpSVPCJf74/isdj61ogiQ 7/gjcDrldE6GE5ZOknlt+z96h6UZfh1bwI3kNCXIlMNI1XwEfZLwXvOOKWyX2yEPFrBP x1bdRqlMZJDeB4vSGCxqYGRbFFXIAWXIplTTnXHZm8NR57g6qqciLkEGVOrqrkHMzdqe 01nCgXkVPfK9gxdWZGaG3eOtR5OTt3yDZRnwWimvObGfQpdNruCaZ6/zJ1E8/nkxg+Zh cAoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=iHJhKmGQqCai2aXcZ4aOCA0kmVef8wBEFj+cwGJWIrI=; b=D3RCfgn7+Yr5Se2YsN9jfEuUjhX54tWLuvqEA+HgROdUlvG7OzfH1Q406EvUe70j7t SegZGli2ROD5eQqxs338iVjUXH9weZYO8w14mv0TelyYq4TuJ5VZngZjkKoP37tVIcZu yEw7fsKtiOpZRxeaqPbEdaXfO4s8Md7o/BzZDVqcqnIIo2qdDpztdj4qokE8WgKOTOSb LSG9R0bnHdb+2DRj4NyCVf6fdhb0ni3bSmBuVaeaIsYEVJ554Hjmus2D9vtCSalJ1kcT I1L9yILxkXTnZg/gUl2s8S3/xaEsd7T1UVTaMiixtIKl0dlG64HFuegpQlXtw0ONF7s4 7Paw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=zXTWTjNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si2247120pfa.390.2018.04.12.02.25.31; Thu, 12 Apr 2018 02:26:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=zXTWTjNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383AbeDLJWA (ORCPT + 99 others); Thu, 12 Apr 2018 05:22:00 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40573 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbeDLJV7 (ORCPT ); Thu, 12 Apr 2018 05:21:59 -0400 Received: by mail-wm0-f65.google.com with SMTP id x4so8336057wmh.5 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=duyfNI2C0QsJ4Ef4xHadLiEKu19a1+bX8sWY1+qeAvZU1vMZahF28D1w3y/916eWIk 2b701pqU/SB7YFvVQZoVYdQCi+zm0be1OKBC5zKqtj9RfwuTDzpxeEQmHWIicAob8Ynj p6oeE71s1nDppaUxdXNr1N82vg9l1Bk91lWjHhxRSh9gSc1SBANvFsZvh0NAe+p4IvSL 3iZXo7lg+mBDcPBKN0phj2FSt2wQ5rGHcswWjk5evgWgaR32ruERCqKXrg1hqDT51jpP SlclyRNu6t7YH2Xjr+gMLnDcqAZoJ++RMl0FRXlsTHx3BDhfw+09DweMwc56LE6OvSGQ fnSw== X-Gm-Message-State: ALQs6tC6jaC+qYwmoXhECfiSUr/x9wx1nF4q0DlZvxAAR7uReNfjkA6n eACZEUWErDzfYlNhQHfGgHOliQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4