From patchwork Wed Jun 21 17:55:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9802433 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 7201760234 for ; Wed, 21 Jun 2017 17:56:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 611DA28634 for ; Wed, 21 Jun 2017 17:56:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557732863A; Wed, 21 Jun 2017 17:56:03 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 D6C1F28634 for ; Wed, 21 Jun 2017 17:56:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751140AbdFUR4C (ORCPT ); Wed, 21 Jun 2017 13:56:02 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:6943 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbdFURz7 (ORCPT ); Wed, 21 Jun 2017 13:55:59 -0400 X-IronPort-AV: E=Sophos;i="5.39,369,1493654400"; d="scan'208";a="27139780" Received: from mail-bl2nam02lp0084.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.84]) by ob1.hgst.iphmx.com with ESMTP; 22 Jun 2017 01:55:59 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NG5jUaq2xb+8g48GPXCVUKP2X5EpyP3hpiduyFOf1No=; b=dy+ranncjEPR7jrJgNcFQbQi5w5HrcxdUiNY3DcR44aYDWTFVZMk9wTanzTxwjCacxC9tTi89C8yMAywGbMx0zD9BjFPBpc6/YVCrgN5rr0ysWD5Z5se11CO80luh3N59QVInITFCH13ALTNiRVWE9xyKUQrmMOrNpymbJOVNpU= Received: from MWHPR04CA0057.namprd04.prod.outlook.com (10.173.46.19) by BN1PR04MB552.namprd04.prod.outlook.com (10.141.65.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Wed, 21 Jun 2017 17:55:56 +0000 Received: from BN3NAM04FT004.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::202) by MWHPR04CA0057.outlook.office365.com (2603:10b6:300:6c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15 via Frontend Transport; Wed, 21 Jun 2017 17:55:55 +0000 Authentication-Results: spf=fail (sender IP is 63.163.107.225) smtp.mailfrom=wdc.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=wdc.com; Received-SPF: Fail (protection.outlook.com: domain of wdc.com does not designate 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN3NAM04FT004.mail.protection.outlook.com (10.152.92.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1178.14 via Frontend Transport; Wed, 21 Jun 2017 17:55:55 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id AB.88.03809.A23BA495; Wed, 21 Jun 2017 10:55:54 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 21 Jun 2017 10:55:06 -0700 X-AuditID: 0ac94371-10e5898000000ee1-d7-594ab32ad849 Received: from exp-402881.sandisk.com.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id C2.4A.18148.623BA495; Wed, 21 Jun 2017 10:55:50 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Hannes Reinecke , Ming Lei Subject: [PATCH 2/3] block: Fix off-by-one errors in blk_status_to_errno() and print_req_error() Date: Wed, 21 Jun 2017 10:55:46 -0700 Message-ID: <20170621175547.21692-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170621175547.21692-1-bart.vanassche@wdc.com> References: <20170621175547.21692-1-bart.vanassche@wdc.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ka7WZq9IgwOHJSxW3+1ns1jwZi+b xcrVR5ks9t7Stjg0uZnJgdXj8tlSj903G9g83u+7yuaxfstVFo/Pm+QCWKO4bFJSczLLUov0 7RK4Mo69mslYcJej4sbNqUwNjAvYuxg5OSQETCQm3j/BBGILCSxlkni90LqLkQvI3sEoMXXL KiaYonOLjzNDJFYyStzrPc0GkmAT0JM4NW8fWJGIgIJEz++VbCBFzAKbGCUuTWoCKxIWSJB4 fLCBGcRmEVCVePhiFwuIzStgLTH/wSZGiA3yEtPe9bKC2JwCNhKnTh9lgTjJWuLQl/uMIEMl BCaxSkz5+ZENollQ4uTMJ2BFzAISEgdfvGCGaFCWOL/2CdsERqFZSMpmISlbwMi0ilEsNzOn ODc9tcDQRK84MS8lszhbLzk/dxMjJNgLdzC+vu19iFGAg1GJh9eizitSiDWxrLgy9xCjBAez kghv6yagEG9KYmVValF+fFFpTmrxIUZpDhYlcd4s2akRQgLpiSWp2ampBalFMFkmDk6pBkY3 aaM5GZfr5h2N2/R5+oxncTFnvvzz1NSycWhdemCJ+zrFY7Nu1jXMtOnsUbmRVbjhu8CTS4cj wgqDpr4PjL5rlVpd+sGYYX1KG5fogmBOtzOr7v88ySDRaqEd/fBehtn6pH+3tlgc5pzyPd1c MPzEZu+dG2ctOmd4QaikYHFSxTYvjr1rfkQpsRRnJBpqMRcVJwIA32tgY3ICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHJMWRmVeSWpSXmKPExsXCtZEjRVdts1ekQe9RJYvVd/vZLC79+cJo seDNXjaLlauPMlnsvaVtcWhyM5MDm8fls6Ueu282sHm833eVzWP9lqssHp83yXm0H+hmCmCL 4rJJSc3JLEst0rdL4Mo49momY8FdjoobN6cyNTAuYO9i5OSQEDCROLf4OHMXIxeHkMByRonb c96xgiTYBPQkTs3bxwRiiwgoSPT8XskGYjMLbGKUWLylBsQWFkiQeHywgRnEZhFQlXj4YhcL iM0rYC3RfHkKM8QCeYlp73rBZnIK2EicOn0UrEYIqObQl/uMExi5FzAyrGIUy83MKc5Nzyww NNIrTsxLySzO1kvOz93ECA4RzqgdjNcnmh9iZOLglGpgNDp0dOme2I7sbwq+bH0/0s3Y9N60 7F/tWPZFtN7qaPh0J9FfP89++x4TuC8vdVlK8YRsRg8LZ97qDyd/Z/3knjx9vc+dUiG/F6p2 /xlDfB9vN3bYsWTrNv/j01OWmi2Y6bCo0VlX4128/tS5H/ZNeWx6oPJFxvup4YtEigU2nmFa l2jzyLW/XImlOCPRUIu5qDgRAIh6k1LBAQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(81166006)(8676002)(50226002)(4326008)(8936002)(110136004)(38730400002)(72206003)(478600001)(1076002)(5660300001)(86362001)(47776003)(305945005)(85426001)(50986999)(54906002)(76176999)(106466001)(50466002)(77096006)(356003)(5003940100001)(36756003)(53936002)(230783001)(189998001)(6666003)(2906002)(2950100002)(6916009)(33646002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR04MB552; H:milsmgep14.sandisk.com; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT004; 1:oB6LU9xQi0ji98x3mMUSLe6MGg0YqqPN+KOyYRK1qZFpQasfVqhw2pv4L3x7eVt+I89Urqpy6RIDS7xj7rBI95nU9xaJSODIM0qCZzPxTyPpZ7OGPstma/Yqc4b00atpNBRKoV2+6xteHzLQ+9Zp5QoKlJzSA9ecWLKER0ffNiaxdk5OI3/NQ377pGJmH9O4L40e7McLXljP4bxlJxkN8Yed+xfYnj/32BVYv7M+ZTj5e8uJK7CCOIeLlcieqNHxxpLNKAjDxfzAmPDtHyhSBi3e3PbXeJdL2nUw8QaOf4YOtnL3MI171G4MBVlx58bXEro0tkQsh/six0RMDjFz+1XvcttnN8it244sRQC90NJYAJxc1Ve82zq7Tg0yZzn706YI7ws5NqC2oyovW6MCoE1JkZ+Nf/Jvuj4w7sPPKlfPYfYjH1zAdR28q4ZZDoGUUPvFvYc/8uT3WqGy06t2J0loIs3ZeF5ZXK4y9YYm1ZBWUm7fxVGSG7ZKnSnjOQeB3jwaO/TFo4wdA3exBlvv/49vm8hQb3cfOAHYBoiICfUJSDKt9G4cn7S1lsPl/GgN X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR04MB552: X-MS-Office365-Filtering-Correlation-Id: 1f30fc12-20e6-45ed-b660-08d4b8cec3e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BN1PR04MB552; X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 3:DuAkrk8TyWJM6/HXk7mQK2eseeToakQ08ys9yg7M1Szxh6VNzo3G28vVPs5FKlX4uBgC7xas2oS/AlANurp5jwbR6XqJxG/MHFdiL3saEc9k0iplLlP9q6fU3vnW3nCMhE9NbHZF5Kz9mW5aTwGctS28pfWQW7AYHvaZfdsTn6nbE9yXQl6Xvy7Zi73tZF95Q5Ptd6mTWLyQP25pDzyaoLi2K5FQDeNlRJtoC6RhhqvFCTrr11jLER9qTGvCELB+G4AB8sYwzuwFAjteOJzp+VYFgCSWeYxD3hGDFlRx7oqog9+IZJ1R9a6m85KDfaK/VvxGgOc2xfsQpM8ptEE8V+m64Lue/93qGdAbHdhhP8aRwJFzKOcC4V2MKqqDViA7HXL9uGVG5o4J/7T/YlWtZogaE1vR7QcEddQSX/LQwc6jIt2iYPq+5yFuWqqKXs6p9/AqQO76HjVImRkCEMLSGGnyVJh3Tp/5ORGSaY3Fnfs= X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 25:JuWV/jTnZJC1/2ny1U6u9TFCrErK2t4Gr2gLAHqkb66StF5gxxnVWI1/FmyGQH+GxN+vmWyKSpcTXGnonOOQ/umzbyfmCFC9MCGfYWwv9/B/iPJWeYbnpoTa8nkSBHMU3gMaIE4g6IwlZugjLKLVkdVOym18GQJ/7N8cOTIgz7tZCsSMMVvYzyCs/m+FsFMjWzFevHCI9IsROEPBoosCJ31yVqU+CCy0kFdx4qg/6lhrIpPw8mKBcc22Nfy9RTljvBXNK90aH1lnZtAGduCsDb2mjS7ikeCCbu4xjt1B42bLRNSXLxVZ5Q+TIVxlFTasF8XMrnBTxWJnBGyfr5K3huV4gcGk2ooHpmOSmhcXCnnxHd2XNmvL4miY/IyaGOsdRg+Y2PVbKsH3jMEDziE67UYiBPx79kaOUgpbA18s9oxA7SD1l7vGKWndgp5LX99rCoXpouIB7x1tTtCcQdaU0WbhrKhSGuUX5PoWPxwN+kU=; 31:7WP2wGJYZpn71gxlxmSb0azEFXiYz9Cl76OQod2BbdMTyX9InOZaMwvREL0DRh3P4MXd7c4eocyXJLrQc2tFMarolZY2pE3V8SZmKPyWPUKMQXfzPajOtGXqiFrkIfVddaC0nMfRXOqBH/vEL0KSl/LbkJPCnwFqRlCip26tcrzW/wkAGNQ8nTbZRdS6dTEGxXiKM84+hlKecSFdb//cOEC8u/VgEcYQ8rc8qf8+t80MgofuI/dJBO6qvYdxQIYV WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 20:hlaif5GdDTG1JLMFeU4/htIJpPe2RuvuDOcauoKH7I9SkVqAimcKqDATUxV7ExQiMWeTKcq3xyz5Ufp/RY3GBzP+2zd8S00YeDSPAahoFMAFGn202FDw4zXeUtKDcRVAAuezgqQtCIb6eIKWY2cfaYcEgqYjDw2gdANUtVHM++0tE6dLrUpEk1gYl1yPsHxnlzc/z270gyHw3NCyYugXJk5ZWOWKy+/iAvJHK8WaYMsdWhclo3VLO0KAVeKJX47jLVUifmoq8nh7MQ791PYLoA0oHIgrBYYE0SBZ6kQg5eB/wBo17pFtHMYUt3TzJsCzIiRVkaVbkOwqI3qMpuNr5RMKe+R3AaW3MI+6GxaAieGiQtGTkFqt5l9Ks4gSjb5im0bgSWVt7/dudzyG3nBnb2pB8Ye8p+84cwq3TX8nNR4CLNLdjDp89XVpmfsB/1nT3Wx+I6TpjQLxX6t4eOGl8YRDFQA0oklOhK+uHOwVFErtWi36GXCzaEzZtdRanz9J X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93003095)(6055026)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR04MB552; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR04MB552; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR04MB552; 4:F5JiJxrCVKzGjOezVRUNmD90J59V+uBs6anJ8r3zM6g?= =?us-ascii?Q?wQtXXvDCXobHdM/KNyId/CMS0cyjRhwdAT/ZxgTmYYjYSZzfpLNsGjXlZLuj?= =?us-ascii?Q?1abbJNj56lXrrE2GjrhnOuUBRDZm+/mab1Ej9QoqUv9EtvHnuy/M3U7CLeIr?= =?us-ascii?Q?kTdYTs8iN3nxU1SptFAs80JmFZxn7p/KYN9eJcnDXecqoNybgOgLZGdUJ8Gr?= =?us-ascii?Q?SZXuMq7gS9AbNtvseMzahx5ToQwYczgqLKixXUjcFaZRxBVYRxV/vLa9LoIz?= =?us-ascii?Q?TZj1PDDFPATXh9CELJV/IKhe3PNJBVaidh0mj01cdM0e+ZDnlAlVbczKQhCX?= =?us-ascii?Q?O5fyef7N7tRid5IQwu3oWAeZ9mouVtzVuQHG3hoZ5E7/HK1LbZl/RMxbz5nC?= =?us-ascii?Q?3ZDCbp2wTeOKQYa9d3pD+87cvuUdWwaG+bo0O4CYblBoyAaTo2pnffyyfEJ9?= =?us-ascii?Q?KBV6dmrCboQqQJtuSn1Nsx/+m7LbWRAhmZMAvEOKgW8qM7GE6SaxkF26NkuU?= =?us-ascii?Q?aDAjr/m93BBt6/ugC7ZES9PbdhOi4dzWi54HP4VnljoHcHciJ3gh9Cq55WyT?= =?us-ascii?Q?tYNPEn4mJWjmgNadvgYCiLUYfPD7fPVXxOvfvcZArtUVpYEvY6diEr5KZWce?= =?us-ascii?Q?c+XAkijfICEDeFdlte1Si1m5FN9IlHSuW/ujYEsRXol0AxDtvW03hpQKrgQy?= =?us-ascii?Q?nHp7D3ESZ/b6UoMt1l/eD/ObuQj3ue1DYCE1sJA+Pyg0zAH2d/zGUWQ8mob2?= =?us-ascii?Q?k9Pyr7d+FPL711wutpAoAwKADx+PMFDT58WRJqWP05RbWaOpVi+/5sYqygVo?= =?us-ascii?Q?VKkmU/Ap9Qx5wg+0YFwrqUI1JcuXL+np0TTyiEFIk/PtXqL/zQSycBrV7LnB?= =?us-ascii?Q?/mFd8JLCwnndAPQGQj97YEgvCBSkob8cXXc2oVVfJKjbz1diygkqDNnRT0jx?= =?us-ascii?Q?K4hA7+7wv4qNYQC0d2jIei0BQTo05x7myPOyx+UWhKWT49jsd9qzHTR5KUs7?= =?us-ascii?Q?cThnkOB+LJuEyl9YRigvw7w1SVTmG9uPNK7hkbMQ869wWzElkZ08jxXNJOT+?= =?us-ascii?Q?c/81492IJrP1BYLsalmJ/BBe9F16+vEXDWDsUS3F/WXBPqeJB+de+NgD+2qa?= =?us-ascii?Q?WlasRlKuEzMyALNUB+O7w44nB62uvOzFizrg5eQWOniq0CunF5mXHZJwwQjC?= =?us-ascii?Q?0bjzM3eGKRk76sZ8jvTGHAMCADpvUO4Pk?= X-Forefront-PRVS: 0345CFD558 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR04MB552; 23:HhP6McAe3zpkQP2TFpORNU23CfazRvaE00pQ1wSZsS?= =?us-ascii?Q?XrcQlEQBYvHpZrGF2wJU5Zbt+0CgW5yfL81AfJud1AYvQGmSoLPGp8VST4kJ?= =?us-ascii?Q?tsK6UfG6iSFOyleF5xM8Yo1595ykpe+rV9F5xl2eTdw8lr15WBMJLOOzyoNd?= =?us-ascii?Q?qu7JgNzZgRn6ZQs75u8n1VjwtWREGL0pcUxLuGAr+caBbA+IfUAA40WQddnX?= =?us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FZ?= =?us-ascii?Q?XXWABS/XbURkdP89HeuWl86GB8hmPWojVKcys8jNUNl+ZUhjMVm9Be+7a7GC?= =?us-ascii?Q?7kUpxYHBBey4y4rdqHOje+LxjM284NRE+hrGnMett8brVrnaz4PRrScm2Rpe?= =?us-ascii?Q?Wno1UIXiqO8XKo3tkHgaiFy3O3yo8sa7eI1j4zczyU35EYkJlTh82rYE/+SL?= =?us-ascii?Q?0g4OC/aHErRKPXkxh4UjKksQ5yuRuNXpfRiP7Ops1bWcYCDKMzdinHHPUNk8?= =?us-ascii?Q?BcR1GIRMDP7KTdRSDlMbP?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 5:yytH+I4GQMlS3GU6lFPbhriJi/PPz1Xh/ho9pdozMG1CYAc576Y9OlyxwP/nTb7jg9cC0mSHMcb242Z2zD+DNVSyFyowsBlT5K9LFULEBR68TS63EhZ6yfrr2yi5EVwbN4OEMdeR8y5JRKJX4oWfocL/Ec3LUB/ahqXYiP30ItHSdLf8NT2TX05uTQaygOKDua2ZON0QYQxFDUa74DoSBKHWYCg3eMmp089dfmy6EDACVeNG9sQrIsn8MjHgSvS/1YoG+7eqRD0xLqwXT1kllG0ybBWJBaB2xMJ6kKsXctD0nLYgmeYeGVYny8KCiAzxBC5TAwKIEpA7xg96iXsJaIdPZbVrG7U6eWG+Jx9BQKwomrBDBiN+a8pAjWDAq4NoSTRKJ9ad28l2/ymQPExRfnkKDrOzzMz2X5WPyvh8eQbGrxT7u2ZhZeZlNzZSo5RPWH2/tRIcu4Yzeqo+hxB08M9cnNBWLRJwyLjMdyppqkDrCua0O6BAZSOMPHC0MeNM; 24:M5RSNfBK0TLR9pLVjZE6FILmTM8NNQ8QQh+70XxZzmzTlaHLM9S1xQ4GGhfunNHHR0m3K2RTZ31nWcpHETKCoX4g4Be62abjbemay4PJ1gc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 7:iQ9Q72zdrMUy0w533d8ZJI4ZxaUd2Xz2XPHHS/SAyJnl/xEtAuxzi62qiM9g0Rhanir2ukJhCbwYzh3sJsiD5ziwdTrX57fSdCGIhEVLrhKfIK2LRbs0cGCg/8+d97hrG1LSf3wvdKRHKDpM6LE3tIZrfOsXESjxLMipvp6xGhv9ogkgGmMn+b5ih/dn4L1xSrRcwNXNaPenyfe3xtoAV92zl5RZ8+9KVkh4StinwTxJ29BKoo6KDxavYnEVmmNMF1oDXigvZn66HZaE4xC7XiGlT08dA1DEqvKFys/DZgr7X5RkMJmBIqB9moXxvR0G8eVD8mNqJh2c6RBIL1AA3XMllHGmWXDLR+EnwaYEFHmS3WKunATaSGCNXylVVK0qX325m9AxLJPq2UgHRNd8CKkKLgzYJd2Fu5c7/rnHrHajfGhEPuB5TT82UqhLsreUsW6RZlgD82v1JpFEhFDZbv74Ktk5093UmyvfAZOJliazEyCVOwcWeCDXrk2BUC9vb/g1YCpvKtaqjfeget4REgryYO+y+rvon5DXJnQ6GoUv85a1KnTSQDbE9S+RKe4lkJgpioZtHeTEMrQ1pdgWnEIhETmgHz+4oIjp/dm50+BVcqe9/3QddaVWvskt0psqoiOZBAL2NQzlqot35wrjhM6Gccr6zIg1htcu6gf41dymeg1Z48aWPEFO/SpGTljXlukiPhu3p9BO+GzNTLxVa5jfJ5QKLge289J7Gn0xyy0lW1TeDNUjvPrWbntKNRBjPO+qY+WcHkVI6V9IQ25QG99mEK/6IzVGEv7Q57udcK0= X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB552; 20:CA8NobGRAunkYiSgGDOxEgexwl/oK97Tac9QnLnjeoC232eCZ87RALYJQkknJaKvNETatlaHsbXxRZZAPgqu/QOaWzPg0NyYk99GGF4pEKln6dgq+XBQqfxB6fcAADua1mUrs9tMNJsx8UL9Cw4M3hbWdA6Y2zRo4gP7Tafn7AQ= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 17:55:55.0205 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR04MB552 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 This was detected by the smatch static analyzer. Fixes: commit 2a842acab109 ("block: introduce new block status code type") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei --- block/blk-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 2e02314ea331..3c18ea60cb1c 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -169,7 +169,7 @@ int blk_status_to_errno(blk_status_t status) { int idx = (__force int)status; - if (WARN_ON_ONCE(idx > ARRAY_SIZE(blk_errors))) + if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) return -EIO; return blk_errors[idx].errno; } @@ -179,7 +179,7 @@ static void print_req_error(struct request *req, blk_status_t status) { int idx = (__force int)status; - if (WARN_ON_ONCE(idx > ARRAY_SIZE(blk_errors))) + if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) return; printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n",