From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76372C38A02 for ; Sun, 30 Oct 2022 08:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229515AbiJ3IUh (ORCPT ); Sun, 30 Oct 2022 04:20:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiJ3IUg (ORCPT ); Sun, 30 Oct 2022 04:20:36 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8A75BE31; Sun, 30 Oct 2022 01:20:23 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id B1D8968AA6; Sun, 30 Oct 2022 09:20:20 +0100 (CET) Date: Sun, 30 Oct 2022 09:20:20 +0100 From: Christoph Hellwig To: Mike Christie Cc: bvanassche@acm.org, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com, linux-block@vger.kernel.org, dm-devel@redhat.com, snitzer@kernel.org, axboe@kernel.dk, linux-nvme@lists.infradead.org, chaitanyak@nvidia.com, kbusch@kernel.org, target-devel@vger.kernel.org Subject: Re: [PATCH v3 12/19] block,nvme,scsi,dm: Add blk_status to pr_ops callouts Message-ID: <20221030082020.GC4774@lst.de> References: <20221026231945.6609-1-michael.christie@oracle.com> <20221026231945.6609-13-michael.christie@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221026231945.6609-13-michael.christie@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On Wed, Oct 26, 2022 at 06:19:38PM -0500, Mike Christie wrote: > To handle both cases and keep userspace compatibility, this patch adds a > blk_status_t arg to the pr_ops callouts. The lower levels will convert > their device specific error to the blk_status_t then the upper levels > can easily check that code without knowing the device type. Adding the > extra return value will then allow us to not break userspace which expects > a negative -Exyz error code if the command fails before it's sent to the > device or a device/driver specific value if the error is > 0. I really hate this double error return. What -E* statuses that matter can be returned without a BLK_STS_* equivalent that we couldn't convert to and from?