Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4151210pxb; Tue, 17 Nov 2020 12:41:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvSO7UqbiwGKjJICH8BQmP+ESQT938A/WAf2b4bsHFioWNsUdyBPry7n/zAo3egLCuVRDb X-Received: by 2002:a17:906:4e99:: with SMTP id v25mr20759969eju.242.1605645691635; Tue, 17 Nov 2020 12:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605645691; cv=none; d=google.com; s=arc-20160816; b=mAUzMRtQYHhHhrJ65bb/3TkotKLtVOEfPEU72iJhOJrbn60m9VU/vydCoCFrKlC1cY LPpYkg99Y0dKhRdzBT7HDzpPiTPXqmW6Y1wNSo5GDI6yk3vavlHvOkTXiTUbCFi6gNXZ 7lU5dbSdiq+5VHrcdZedgA0OvJhv8uf+zrBaGyhCt2wUbzOc/1Hs7eKNTi0bKFTF11aQ T9suMM4RgJP6eYbQs+5DfUZdJZC8721ueVFjWrVE3xsi9AKyugNI4jYtNozOEVFqQz3F elbiAHMttncHDxJ6WNR+M15B/6OC8XvycuhxpBTdX/nFN0HgwcaQgA1KwGzyTS28deds YMzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=G8/wxJoq12QfdqHJtRO4GIpzD5Y227qifeERfdJXT9A=; b=KR+mISsH9XS0Ud6G9s4aNHC1H7JRFqBsY38vkrhoRt1Z+lAHmSo1ErT5hLEM8Zq7nx 14axPDMw/bAeL7llTSDmCjAyPyv9qNjkTXPK0EN6fXwwgotYDnz6ecM0uEpSDGtRvJBi pg/R0akvEL90dP8Qw1N29YMix/n2AOdy67SSI086sbydjusCyEQqUWkte4lbwxKZhU0Z x+xTxzVA4/Im+JQYajENIv2dHX9XD1Nc68vSkU+pdP8G8ybj76EmbCUBgfCgW/afdOjG C4tTZFsycf9orMR1Vp6/5y6cgJUVag+4P2450G/slzG8N5TYfoizkNQ5d807h5CrtdEt XMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DQhs56ri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si14701236edr.500.2020.11.17.12.41.08; Tue, 17 Nov 2020 12:41:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DQhs56ri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726278AbgKQUgV (ORCPT + 99 others); Tue, 17 Nov 2020 15:36:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33481 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727480AbgKQUgV (ORCPT ); Tue, 17 Nov 2020 15:36:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605645380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=G8/wxJoq12QfdqHJtRO4GIpzD5Y227qifeERfdJXT9A=; b=DQhs56ri9ZfSjAEDJ9TexE2Djbe9BXpCIo57UzulI7bQf/op5bslFzxO7R21IN7tcPp/y/ Uz4TFc+W+ByBFYAWXGMVn5M24GzuGwU/36yz4xKJeGgFTeImbqny+/+C3+pBudFyCLFr5j 3zMKbDSDHY5z/xHT6eOaF1uFektFr5A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-zg-lqcXVP2uA9_nkr76IBA-1; Tue, 17 Nov 2020 15:36:18 -0500 X-MC-Unique: zg-lqcXVP2uA9_nkr76IBA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28A918030DA; Tue, 17 Nov 2020 20:36:17 +0000 (UTC) Received: from sulaco.redhat.com (ovpn-112-190.rdu2.redhat.com [10.10.112.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9180E5C1CF; Tue, 17 Nov 2020 20:36:16 +0000 (UTC) From: Tony Asleson To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [v2] buffer_io_error: Use dev_err_ratelimited Date: Tue, 17 Nov 2020 14:36:16 -0600 Message-Id: <20201117203616.307787-1-tasleson@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace printk_ratelimited with dev_err_ratelimited which adds dev_printk meta data. This is used by journald to add disk ID information to the journal entry. Signed-off-by: Tony Asleson --- V2: - Move change log to after marker line (Andy Shevchenko) - Remove printk cast (Andy Shevchenko) V1: This re-worked change is from a different patch series and utilizes the following suggestions. - Reduce indentation level (Andy Shevchenko) - Remove unneeded () for conditional operator (Sergei Shtylyov) fs/buffer.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 50bbc99e3d96..32f237e350bf 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -125,10 +125,17 @@ EXPORT_SYMBOL(__wait_on_buffer); static void buffer_io_error(struct buffer_head *bh, char *msg) { - if (!test_bit(BH_Quiet, &bh->b_state)) - printk_ratelimited(KERN_ERR - "Buffer I/O error on dev %pg, logical block %llu%s\n", - bh->b_bdev, (unsigned long long)bh->b_blocknr, msg); + struct device *gendev; + + if (test_bit(BH_Quiet, &bh->b_state)) + return; + + gendev = bh->b_bdev->bd_disk ? + disk_to_dev(bh->b_bdev->bd_disk) : NULL; + + dev_err_ratelimited(gendev, + "Buffer I/O error, logical block %llu%s\n", + bh->b_blocknr, msg); } /* base-commit: bbf5c979011a099af5dc76498918ed7df445635b -- 2.26.2