Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2040065imm; Mon, 16 Jul 2018 00:41:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe0QPY763eXIk3YvpHvNFiZdWwS6bUA2yOEYPOMwz6Fuo5nG4EcQdIdPoVZSFyuZhs8/1uI X-Received: by 2002:a65:6211:: with SMTP id d17-v6mr14887106pgv.450.1531726879823; Mon, 16 Jul 2018 00:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726879; cv=none; d=google.com; s=arc-20160816; b=hUwysbIWORvUxHfFskHo9tTo2Wfojm5jYoOk9yoQuUCG4sNPdvqYP9LdwyYBvn8SRp PSR+GQA62ilkiFwakd9GMTdHj+CmjGH1xz1/5XzH/HGCapPxaikmFTnJX5QyPpt0hpzg e3nMucDfudG++8rhjSormat7u/ZpEbmj86guuqzlPpjtyQmjmakD0d4+2W4/M0dRjPcT lQQ+T1d1HmnenrpFyouAhXq7JsD4XEvN39uPfZXdeRAVcjbfDKY3WwY/RnAmVH0odvvT r7eZZpIhKirCHLYBA8H0DRiMAQ2ToIeQVO2JeWpmFOToAT9fPxBY+Kksl4Vw+gB13DXJ ACdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WvaqKZ4WiQpnMZPOVyH4M3YjdAMnWNuxBz2VISgGIDM=; b=ryN7MyOwmFri3qmvPYoG8XalXJbY+5zBdNBeJvxxmWFq8/gF+zEplwA13IC/lt4i1B PmcK9QmQvi6JMIuGpEb00OzNbzufVdtAqlGFbH3N730jYXH3wSdDt9O5AZVYCG2otdka lm7vDjtdQs/PU2cVPsg+zUad1kxMgsMJ3T62FgtaHCIFo/wt9QOE+Phy5v1+zdiAZlE6 pwMFn657PXkKddzkY4uu+HMdMAsdm6tXAcYB3Ce4ykFa7Y+Os8xaWdV3GmWsWm2HOA8M X3w8TqZ67IB4FFfOB1IxDa/bMoG8y5MvnWSVepwj7TkpurndI6ElP76rwaNA5vRWzeVt x8Bw== 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 t9-v6si12312769plq.324.2018.07.16.00.41.05; Mon, 16 Jul 2018 00:41:19 -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; 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 S2387914AbeGPIFT (ORCPT + 99 others); Mon, 16 Jul 2018 04:05:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47094 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIFS (ORCPT ); Mon, 16 Jul 2018 04:05:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 381ECC03; Mon, 16 Jul 2018 07:39:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Tony Battersby , Jens Axboe Subject: [PATCH 4.17 51/67] bsg: fix bogus EINVAL on non-data commands Date: Mon, 16 Jul 2018 09:35:20 +0200 Message-Id: <20180716073451.554302298@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Battersby commit 70dbcc2254fa2a9add74a122b9dac954c4736e01 upstream. Fix a regression introduced in Linux kernel 4.17 where sending a SCSI command that does not transfer data (such as TEST UNIT READY) via /dev/bsg/* results in EINVAL. Fixes: 17cb960f29c2 ("bsg: split handling of SCSI CDBs vs transport requeues") Cc: # 4.17+ Reviewed-by: Christoph Hellwig Signed-off-by: Tony Battersby Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/bsg.c | 2 -- 1 file changed, 2 deletions(-) --- a/block/bsg.c +++ b/block/bsg.c @@ -268,8 +268,6 @@ bsg_map_hdr(struct request_queue *q, str } else if (hdr->din_xfer_len) { ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp), hdr->din_xfer_len, GFP_KERNEL); - } else { - ret = blk_rq_map_user(q, rq, NULL, NULL, 0, GFP_KERNEL); } if (ret)