Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp516125pxx; Mon, 26 Oct 2020 14:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSoDC9SXI1Fwi1T4oDZezO2MiXp2w0C6TmgGBYRFoFhSmaqF46eZZCVbDAtNgvvrPcdwsW X-Received: by 2002:a17:906:49cf:: with SMTP id w15mr17397265ejv.252.1603746010137; Mon, 26 Oct 2020 14:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603746010; cv=none; d=google.com; s=arc-20160816; b=uyd3SIrJSbPbhKuasEENI6mAUPrXbfEm6y8b+QWpq0PmfWuswL4b3osW66NQDsFPsE dApExECCKggrhxx8lGE1myRUJCOgcUs+E2dCpE2/WBQVcJHy0Ag3Jl5JYi8MXrg3yj8L KGlXK4zsGS1XRDRjRVr2AxZm+UuR2IrOP1lQwSVCa/F0jngdavbL8RydI7AJe2+fpj6i FwFjmJD78GTujiVzW4fr6McBhQx5uPdPDtp9iJoCi00W004ZvBOCZB32MtI3oUIXyrdI ApwB19L1bKxejbCMUJy+8AenCgQKPB/+ivFlD4QjCd3R7KZs353o2k993mRvi0j1u4au 0e4Q== 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=q/E5giN4xsgMxXjTZFdev6gu+e6AnHn6XMpyLORpD5M=; b=a5fsajhCpgj6Pu0QNODdrrELfHR2G3OQoymV/H3ubQCRQUq5y1tyyDeae+RD/gZ8qg YXwE4buxHID/ILH8NDBCGww/SCTUsAvWd0Jn+fnUNMuftX7jb3p32Pn0iyK6TEXSi29+ m1Mk46uTaCuvgSKNDIetLNz1o291a21Oc64+xmNe02/nEx4bhFXuk7/wyVn+hy7lMIhf cSse+LBLIO2ghrxeYTVCd4FcT7UsDvnNc6rXjivMTbNClJBX9hghb/ejD5gGgEEHMKtP 8LXP4j8ODozQytBFG35m7jBMKd4Sqqet3zZMp6cnVacpCZOZKcsM+IfG+qCq0j4jdPF7 XlcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HosoySqc; 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 a2si7703205edf.60.2020.10.26.13.59.48; Mon, 26 Oct 2020 14:00:10 -0700 (PDT) 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=HosoySqc; 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 S1784913AbgJZQFW (ORCPT + 99 others); Mon, 26 Oct 2020 12:05:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21544 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1784901AbgJZQFV (ORCPT ); Mon, 26 Oct 2020 12:05:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603728319; 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=q/E5giN4xsgMxXjTZFdev6gu+e6AnHn6XMpyLORpD5M=; b=HosoySqcJsWuTLNLEqJNhBZAZ0YtrnC1WgfSuUi5x1T20P+oerZKjEyqvnpfkOXOYtoE4G 9bC+Be5Yx3euYQPEwrvNNz/I9SKql1LriMY4UNELN1PQd/nGu2EV3XDp5NRrp7QP7lEPlB 093/isoAZn5B04kBfrU4ZcS24ZYIXcU= 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-43-EEeJnoIoOfCC7NgIavbLYQ-1; Mon, 26 Oct 2020 12:05:17 -0400 X-MC-Unique: EEeJnoIoOfCC7NgIavbLYQ-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 9EFA5EC500; Mon, 26 Oct 2020 16:05:16 +0000 (UTC) Received: from sulaco.redhat.com (ovpn-112-242.rdu2.redhat.com [10.10.112.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1566A5C1BB; Mon, 26 Oct 2020 16:05:15 +0000 (UTC) From: Tony Asleson To: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] print_req_error: Use dev_err_ratelimited Date: Mon, 26 Oct 2020 11:05:15 -0500 Message-Id: <20201026160515.542586-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 --- block/blk-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 10c08ac50697..ee5d63e54a11 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -216,16 +216,18 @@ EXPORT_SYMBOL_GPL(blk_status_to_errno); static void print_req_error(struct request *req, blk_status_t status, const char *caller) { + struct device *dev; int idx = (__force int)status; if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) return; - printk_ratelimited(KERN_ERR - "%s: %s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x " + dev = req->rq_disk ? disk_to_dev(req->rq_disk) : NULL; + + dev_err_ratelimited(dev, + "%s: %s error, sector %llu op 0x%x:(%s) flags 0x%x " "phys_seg %u prio class %u\n", caller, blk_errors[idx].name, - req->rq_disk ? req->rq_disk->disk_name : "?", blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)), req->cmd_flags & ~REQ_OP_MASK, req->nr_phys_segments, base-commit: bbf5c979011a099af5dc76498918ed7df445635b -- 2.26.2