Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17519300ybl; Thu, 2 Jan 2020 07:01:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzSCbcLx/lSdSWtg/eSARSuZJNHajYzvk5zWxNLcIWQa7OIPAMsHBMcy4Hf9raWs/PjVGpT X-Received: by 2002:a9d:7c8f:: with SMTP id q15mr80157924otn.140.1577977292976; Thu, 02 Jan 2020 07:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577977292; cv=none; d=google.com; s=arc-20160816; b=A7OZc5hQ/WGh3yPRQ56Vj9dmfwcWMhTTB6B5mD1KHB/JYGTPMz64GGAlmDEC6wbudZ oMQNS6L70Kbd3aPRdW9YBCf3v5i5ivDG5/m9waDatzWKmCzZ0O9vQoTXYyQdarmQAoWh xZ2AVO/RcG+pXjQpRRb0KhT8UGMQdxtTNEuHhABOkPPc37FPmwpWtmAwDuA6j6Pt5xeT yKurlqDiuhvPJ4et7F2f3wBfwaPUlqNbwQfcs0FVBR6hLmIwYvHFow+R7CgK4FqbtIPl F9NiB5gFks411jwESHihMufngATgAZeiLNRSaS3JFM+eOBroaQ1sOcztoNSifzN5d3gI 4GQg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1AVkuICYuUJ9D3eRwQf8/7qao6yYJFs+YeK6ywV2mhg=; b=gsBesZBcOkgHxXnP1OKjD+Eyqx2OfrLSb5lGgfP91AGBreeiM7Om6Zm3BG2uBvFfUH NL/snvd13pRLD1nlmSCxWEzLD/aq/hdqZh5HBMxFaX5TL+u0b73pv5625BxvyUb8ar1G 6RyDs2AV5OzH77KdoFvz873Z27pBXtjpDuCkWTTv8DS9AfKDNpM3KjsxAz92Ow7mO0KC Bma5mXgkPj0wHZ9VhV2gwXEDt+uDUFXohRs/MQoTZ+R1CUvmSQZPbw2hFmV7mLe8CiVz JhiiYaqWblYhPwwbWA4GfbU+0CU1+B6ZZtnMVGpQhhHmrYvd/Kt/hF2w7+YdwRZB8gli uxRA== 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 f17si25113705otl.181.2020.01.02.07.01.20; Thu, 02 Jan 2020 07:01:32 -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 S1728661AbgABPAh (ORCPT + 99 others); Thu, 2 Jan 2020 10:00:37 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:60753 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728571AbgABPAh (ORCPT ); Thu, 2 Jan 2020 10:00:37 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MF3Y8-1iy5eq3Xmi-00FPMR; Thu, 02 Jan 2020 16:00:16 +0100 From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , FUJITA Tomonori , Jens Axboe , Chaitanya Kulkarni , Benjamin Block , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 11/22] compat_ioctl: bsg: add handler Date: Thu, 2 Jan 2020 15:55:29 +0100 Message-Id: <20200102145552.1853992-12-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200102145552.1853992-1-arnd@arndb.de> References: <20200102145552.1853992-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:/v9BoeMw07nWpYw7u0vnyk6+iF7B9Ivx59/dmMOCA43quUma0Cb LvLgvdr6nk111g9XSXmi72uMA3v10UdDlFT1nwsCVEGt5vo6q0GP3uEay7CQEp+2Bjxbbej b5IDipv+F8eqFr46BmUUI2g8OckLtnPOxuymbLTcB38VCY3+aEVgccCWvTzb1jacfZOgcrF Bu9ksi0IpGAWcsPQAVeWA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:iJ1ciBf4Kro=:ulm3L4FFhXfpjGZ9FP2kXX GRP7BlD+CAPrLeiwd3yqbkPYqdhqc0xp7s0sA3FbN/gmBxw+t+lTsy/SJYTXKsrrhpByqoheF XNkLZkrdKF6VahgIPO4Wlv0JyZd4JbZnebYEPEyTVylSSP44jdggR60kll84/R92BiVUaGhfP 7H3f+mUkQeJZCo2uisJ9yL3khr7rM0mTRCPX0KzL3okPkjic6cWKN+EVU1EBs9c/fFYlHlBJZ R1Ol1e6FWQ2Ka/WINrAq3xpWSapauRQhPdFu3rcc98lfbXV2KYo5W+dn3OW0c38QMnu4gLPnz WxIRqTa2QgZgW2p4PMCdxQSKKLKIXvixbeHzbz/TZ8fjZqMgZXVVqE3J7PbYyf1wNdDLdlfFl IOee34z5uqxwApJ39i9waQVotAfHaZvgSDZxqjqzfyADFiW+c45Yz76ZD/SnQsWSuI8owcjLJ Ihq3f4J5ezbpzkzR1SFk/3DDNLbZlfQLpWWbMaHkh+bIvcn331kmD3GRjQtNXf/mrMXQEgb1S GMHSGRGFBW2hwQbOU+icy4JZSEIcIgdLCNXax3Nv0oFO0mgSq5BkfRLE1V6tkKiI/2CN4zU+M 7OIwKWiL9L2dcDDGRoH1dxkGjADNbVzSiuvPF4kyrVPWzO1zRzTmcVNoi5kK9BTKHOBJmnZKW AjZhcEvjyWQhAheRoL/Njj3+miFC/SDyoPIUMJX7bBKkUPxmdAQ8G6z12cfJsnXTU46ZTYeQz i5n6UaK6gDbVwv2vV7h+A/sWUzVobF/7R9vBjZcrlv9ztJQNApCXQTJNXR0FU1jZDluas4CtG f8PUD3qzSi6YAo/UhTqUVLk2r0jUy/SuDyt7eGYrQFXd+2n3PAW01OzGuVpmqkysmw3U5Pt1R /AZ4VVxCvjfMJEIpNo4g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bsg_ioctl() calls into scsi_cmd_ioctl() for a couple of generic commands and relies on fs/compat_ioctl.c to handle it correctly in compat mode. Adding a private compat_ioctl() handler avoids that round-trip and lets us get rid of the generic emulation once this is done. Note that bsg implements an SG_IO command that is different from the other drivers and does not need emulation. Signed-off-by: Arnd Bergmann --- block/bsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bsg.c b/block/bsg.c index 833c44b3d458..d7bae94b64d9 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -382,6 +382,7 @@ static const struct file_operations bsg_fops = { .open = bsg_open, .release = bsg_release, .unlocked_ioctl = bsg_ioctl, + .compat_ioctl = compat_ptr_ioctl, .owner = THIS_MODULE, .llseek = default_llseek, }; -- 2.20.0