Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2769118imd; Sun, 28 Oct 2018 18:01:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5f4VloyfrE62b327Y17DCQ48AHtEKEYDEnh1faG4iWtEeevvKYCDCNPxsCPajmtvfxT1s+m X-Received: by 2002:a62:678a:: with SMTP id t10-v6mr10570735pfj.139.1540774901242; Sun, 28 Oct 2018 18:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540774901; cv=none; d=google.com; s=arc-20160816; b=rf4WX8JYRLgsvIVAYEX8nex0obmWmqSIY770tdCrUlhRZvuD0AeeLAOml2s8jjqGLn SwecXVwu+iVbNMwwKbjSNqHvN4vvPuIPSAJMLBCTafg9oioIYYbLKEC2afS6LL6jKyEe yF3eNZJ6lhJMBVnxWxJUh8DA6Vjlo1fWnwfgePKVGTZKSrbiMcVV7JLDblkBAAC0fWk2 S7l8oavhw38YUc8BqKdq+5IcUTey9u4ZeqZvLeb/6KnTUAZslFw05sKmo8V2sId5g0QT CMgmVOX1SG9iyUMAuvkTBmLWtnM/k4bECpO0G9yOOYRjjlmZQoofzsrLUoQEuksXIj/Z 8ptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=dwtwKmwFXM5O3E/PIhsvpPhvx2frXCKIHEq+6NBc88Y=; b=lrC5F2Y45+HEdSnOgfUsat7l4xcb++/IJKYKHNGz+A8UtLGX51fppB8ewAl32Bt74E 51txJd62m1AGxhSWNEMR2EY1gJlIO5XrramjHDF20bazGCe91zAQZnBjmIE9XNUa+RGU 6LLMW72sCZYSgmIKMU+eHM8JTWoseJO12SbD8F5kHQleOcQ6CEmq1nnOJKGorCcIBkSs aVPbVzwQR8GRCZcj58KT6Eoo00X6M4NSxSPHJvV/YC5+PZBvi9n24Vc1XNPY1JNMblBr uKw5c74hrA/HkcuOW07kcmkKxQL6b7WYSc6NBbMb1te43Q4K0E87Xs0UBffH9PvjnLFW 83BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="rmHX/vN3"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12-v6si17980044pls.35.2018.10.28.18.01.25; Sun, 28 Oct 2018 18:01:41 -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=@amazon.com header.s=amazon201209 header.b="rmHX/vN3"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726088AbeJ2Joo (ORCPT + 99 others); Mon, 29 Oct 2018 05:44:44 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:51756 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbeJ2Joo (ORCPT ); Mon, 29 Oct 2018 05:44:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1540774704; x=1572310704; h=from:to:cc:subject:date:message-id:mime-version; bh=dwtwKmwFXM5O3E/PIhsvpPhvx2frXCKIHEq+6NBc88Y=; b=rmHX/vN3nLul+BTfJgACz5o57u0AK76Wq0QFjiPoPvXYl9w1OhSytpWC Ky+uqzAaU/hLmgcrtY62H5F286Ii7Z+CgrRKlCQQEEGfsRQQLIWZruYk9 8+TOMYTDbeq8Clo0se46qPnsBuaNtmA2QO1e0pZ7j/ZOegNhSE1QzfcU8 M=; X-IronPort-AV: E=Sophos;i="5.54,438,1534809600"; d="scan'208";a="761685552" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Oct 2018 00:58:22 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w9T0wLaS077538 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 29 Oct 2018 00:58:22 GMT Received: from EX13D01UWA003.ant.amazon.com (10.43.160.107) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 29 Oct 2018 00:58:21 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13d01UWA003.ant.amazon.com (10.43.160.107) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 29 Oct 2018 00:58:21 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.62.226) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 29 Oct 2018 00:58:20 +0000 From: Balbir Singh To: CC: , , "Balbir Singh" Subject: [PATCH] Add cmd_flags to print_req_error Date: Mon, 29 Oct 2018 00:57:32 +0000 Message-ID: <20181029005732.21040-1-sblbir@amazon.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I ran into a bug where after hibernation due to incompatible backends, the block driver returned BLK_STS_NOTSUPP, with the current message it's hard to find out what the command flags were. Adding req->cmd_flags help make the problem easier to diagnose. Signed-off-by: Balbir Singh Reviewed-by: Eduardo Valentin --- The patch has been just compile tested only. block/blk-core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index cdfabc5646da..28b8f93835a7 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -256,10 +256,11 @@ static void print_req_error(struct request *req, blk_status_t status) if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) return; - printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n", - __func__, blk_errors[idx].name, req->rq_disk ? - req->rq_disk->disk_name : "?", - (unsigned long long)blk_rq_pos(req)); + printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu flags %llx\n", + __func__, blk_errors[idx].name, + req->rq_disk ? req->rq_disk->disk_name : "?", + (unsigned long long)blk_rq_pos(req), + (unsigned long long)req->cmd_flags); } static void req_bio_endio(struct request *rq, struct bio *bio, -- 2.16.2