Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp682816ybl; Mon, 2 Dec 2019 16:49:53 -0800 (PST) X-Google-Smtp-Source: APXvYqyuux8sKuLinoj0/uXy6TKzWJumJX9b+oZ4QStknpBu+VY8XtAAKN/t7si6a0sMkrUbkOXO X-Received: by 2002:a05:6830:114f:: with SMTP id x15mr1358967otq.291.1575334193172; Mon, 02 Dec 2019 16:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575334193; cv=none; d=google.com; s=arc-20160816; b=J7JQtNjLQDKoLM0RNJkt261LtTRYPPpkIAW7dUu8PtYZRz5TzObsU6iaam2kGXsvZ1 FfBUOcISlr/TgyYOywfrQI2krzHIHM0pv0TD3TjddsMZGqrNjrkqpqy4QGdtp5Ixhwqp 0sZx4UvuuE0DsfQaL65KNmEXJqPJ/O7AJFG3knxFjXlCMXj6Gx37XYwnub/yoo7v0i1A Je3qAkfit4OR7+11sceezm1Sim61iEeibRJmawNMF9D16IZmika3jvWtLwGQQ4yPMejj uJ/Y7rDV4Z7cflK4JZ5jlJbouBa+A9ZVKGOpVRTlZCsECyC3qaB+PHYshkKzutFCLhm+ SIvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gkqruUigiDLwGAs8n/4um0iYijs+j5UqnZLX14xEyPw=; b=QPPkKznmx4lsFQmcbusrYX/D68kAkhuhHlwPl2KtjoCvzVUSVHKEBUhbxpbDzCP1XK 45ipSw3+iRwyh8jXuhmXB/y8BpQFPdlzWq2eJnJNLN3G2GhUx6vWuxprBjLxvIDE20Lx 59PMe2CCVTU4BacZ7h3e9UxXMCfxWM07V+9FH8r1LVw3Z368OIjEhMBlL/oYmkXOUBRi 8UTKu2qTXOgYXHJ1r6d+TUQGCOHOQw/UNHflKVUfQUBRtLJ/GfaghXM1q/9Fm7ft9SMH fKHPtF0H9TPOn6yiDF0u15dyj/BfkBlxAj1FHWk7eWDXFSx9BALqvlgLZsAOOhkZdb7l KAzg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si470122oie.176.2019.12.02.16.49.39; Mon, 02 Dec 2019 16:49:53 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725957AbfLCAtA (ORCPT + 99 others); Mon, 2 Dec 2019 19:49:00 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33964 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbfLCAtA (ORCPT ); Mon, 2 Dec 2019 19:49:00 -0500 Received: by mail-pl1-f194.google.com with SMTP id h13so868424plr.1; Mon, 02 Dec 2019 16:49:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gkqruUigiDLwGAs8n/4um0iYijs+j5UqnZLX14xEyPw=; b=fYGNwNz6hWvNXHkEaPW2L/TlVoPEsRkkDioESZb0jTMpBYMXdPs8JorYD88XNAqVMI FOISPgBgSsp2qsQ+AQ1QGpFOQJqWX7ivpXzrgAKJUwSE6PTN1Pgk/cZm1XyT+5UYtVIu pXYDJ8izriH+wZ6qbN4fEDg9Fe34s5RbwsELrUrXmYzeQ47mKc23a423AQiNYv4O+6wf fQEzO9qbrM/iEA4yBY3upRey0HLd6/rx/AYB3M531jYXz3JTuMooyUeYKNMPLg//C493 dUaNCnj1dIM/KoPITUzCgd4P52KYTK1QOsiv910oOlOBWhJ7ctf3mcKa2qdAu9vNsmOm FzCg== X-Gm-Message-State: APjAAAXcRMnbaf+XfH9ZbCzj+CFwbJwDf5LVnnMYJIOv5ieNyPYKoNRx EbYktKc0djBVxCtcvdiBxxE+ABvZ X-Received: by 2002:a17:90a:8d10:: with SMTP id c16mr2352771pjo.109.1575334139105; Mon, 02 Dec 2019 16:48:59 -0800 (PST) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id c1sm733565pfa.51.2019.12.02.16.48.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Dec 2019 16:48:58 -0800 (PST) Subject: Re: [PATCH v7 1/2] loop: Report EOPNOTSUPP properly To: Evan Green , Jens Axboe , Martin K Petersen Cc: Gwendal Grignou , Christoph Hellwig , Ming Lei , "Darrick J . Wong" , Alexis Savery , Douglas Anderson , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191114235008.185111-1-evgreen@chromium.org> <20191114154903.v7.1.I0b2734bafaa1bd6831dec49cdb4730d04be60fc8@changeid> From: Bart Van Assche Message-ID: <7d4508c7-a3fc-67f6-392e-50a6247898aa@acm.org> Date: Mon, 2 Dec 2019 16:48:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191114154903.v7.1.I0b2734bafaa1bd6831dec49cdb4730d04be60fc8@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14/19 3:50 PM, Evan Green wrote: > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > index ef6e251857c8..6a9fe1f9fe84 100644 > --- a/drivers/block/loop.c > +++ b/drivers/block/loop.c > @@ -461,7 +461,7 @@ static void lo_complete_rq(struct request *rq) > if (!cmd->use_aio || cmd->ret < 0 || cmd->ret == blk_rq_bytes(rq) || > req_op(rq) != REQ_OP_READ) { > if (cmd->ret < 0) > - ret = BLK_STS_IOERR; > + ret = errno_to_blk_status(cmd->ret); > goto end_io; > } > > @@ -1950,7 +1950,10 @@ static void loop_handle_cmd(struct loop_cmd *cmd) > failed: > /* complete non-aio request */ > if (!cmd->use_aio || ret) { > - cmd->ret = ret ? -EIO : 0; > + if (ret == -EOPNOTSUPP) > + cmd->ret = ret; > + else > + cmd->ret = ret ? -EIO : 0; > blk_mq_complete_request(rq); > } > } Reviewed-by: Bart Van Assche