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 6367FC25B06 for ; Tue, 9 Aug 2022 07:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236105AbiHIHV7 (ORCPT ); Tue, 9 Aug 2022 03:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbiHIHV6 (ORCPT ); Tue, 9 Aug 2022 03:21:58 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40E2220F66; Tue, 9 Aug 2022 00:21:58 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 330FA68C7B; Tue, 9 Aug 2022 09:21:55 +0200 (CEST) Date: Tue, 9 Aug 2022 09:21:55 +0200 From: Christoph Hellwig To: Mike Christie Cc: bvanassche@acm.org, linux-block@vger.kernel.org, dm-devel@redhat.com, snitzer@kernel.org, axboe@kernel.dk, hch@lst.de, linux-nvme@lists.infradead.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Subject: Re: [PATCH v2 12/20] block,nvme,scsi,dm: Add blk_status to pr_ops callouts. Message-ID: <20220809072155.GF11161@lst.de> References: <20220809000419.10674-1-michael.christie@oracle.com> <20220809000419.10674-13-michael.christie@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220809000419.10674-13-michael.christie@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Aug 08, 2022 at 07:04:11PM -0500, Mike Christie wrote: > To handle both cases, 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. It also allows us to keep userspace > compat where it expects a negative -Exyz error code if the command fails > before it's sent to the device or a device/tranport specific value if the > error is > 0. Why do we need two return values here? 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0A19C25B07 for ; Tue, 9 Aug 2022 07:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660029726; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4M8V3WS2/t/CmOCq6tFasW4CWqx7g0oImYHp7Xx6bTw=; b=IXAi9qaQHzJocWW54leYKyVsE+t+KPkaQ8LOEXRvbutRNJQzqZVYDjDGfffKidqf2ciorz OsDenHziqtFFeVcaFVobJx6OPkZ4F7UKYl+VYx9YJIFVIDHvp4FQ8P7rzsPaHKLQQ8DOXY ki9nVsJdK+2NLYflYNK3DC4N7kcAOf0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-UhsqhP55PWqlLIiCNlalpw-1; Tue, 09 Aug 2022 03:22:03 -0400 X-MC-Unique: UhsqhP55PWqlLIiCNlalpw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 078B22806AA5; Tue, 9 Aug 2022 07:22:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A668740C1288; Tue, 9 Aug 2022 07:22:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 650301946A58; Tue, 9 Aug 2022 07:22:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 395691946A44 for ; Tue, 9 Aug 2022 07:22:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0DB9E18EB5; Tue, 9 Aug 2022 07:22:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A1139459C for ; Tue, 9 Aug 2022 07:22:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E733E8039AD for ; Tue, 9 Aug 2022 07:21:59 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-363-YiJF9aALNVWl-cif0T0t0Q-1; Tue, 09 Aug 2022 03:21:57 -0400 X-MC-Unique: YiJF9aALNVWl-cif0T0t0Q-1 Received: by verein.lst.de (Postfix, from userid 2407) id 330FA68C7B; Tue, 9 Aug 2022 09:21:55 +0200 (CEST) Date: Tue, 9 Aug 2022 09:21:55 +0200 From: Christoph Hellwig To: Mike Christie Message-ID: <20220809072155.GF11161@lst.de> References: <20220809000419.10674-1-michael.christie@oracle.com> <20220809000419.10674-13-michael.christie@oracle.com> MIME-Version: 1.0 In-Reply-To: <20220809000419.10674-13-michael.christie@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Subject: Re: [dm-devel] [PATCH v2 12/20] block, nvme, scsi, dm: Add blk_status to pr_ops callouts. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: axboe@kernel.dk, james.bottomley@hansenpartnership.com, bvanassche@acm.org, martin.petersen@oracle.com, snitzer@kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, linux-scsi@vger.kernel.org, hch@lst.de Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Aug 08, 2022 at 07:04:11PM -0500, Mike Christie wrote: > To handle both cases, 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. It also allows us to keep userspace > compat where it expects a negative -Exyz error code if the command fails > before it's sent to the device or a device/tranport specific value if the > error is > 0. Why do we need two return values here? -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel