From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbbIRKYX (ORCPT ); Fri, 18 Sep 2015 06:24:23 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:19038 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450AbbIRKYV (ORCPT ); Fri, 18 Sep 2015 06:24:21 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 18 Sep 2015 03:24:01 -0700 Subject: Re: [PATCH V3] mmc: block: Add new ioctl to send multi commands To: Ulf Hansson References: <1442242844-6859-1-git-send-email-jonathanh@nvidia.com> <55F99261.60003@nvidia.com> CC: linux-mmc , "linux-kernel@vger.kernel.org" , Seshagiri Holi , Arnd Bergmann , Grant Grundler , Olof Johansson From: Jon Hunter Message-ID: <55FBE645.8030001@nvidia.com> Date: Fri, 18 Sep 2015 11:24:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.26.11.188] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To drukmail101.nvidia.com (10.25.59.19) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/09/15 07:59, Ulf Hansson wrote: > [...] > >>>> + /* >>>> + * The caller must have CAP_SYS_RAWIO, and must be calling this on the >>>> + * whole block device, not on a partition. This prevents overspray >>>> + * between sibling partitions. >>>> + */ >>>> + if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains)) >>>> + return -EPERM; >>> >>> This check is common for multi and non-multi. Please move it to the >>> mmc_blk_ioctl() to avoid some code duplication. >> >> Yes that's true. I can move but it means also passing bdev to >> __mmc_blk_ioctl_cmd() as another argument. It is not a big deal, but it >> was more convenient to test here. If your preference is to consolidate >> the tests to one place then I will move this test. > > I was suggesting to move it to mmc_blk_ioctl() and not to > __mmc_blk_ioctl_cmd(). That shouldn't cause any changes to any > function-definitions, right!? Sorry, completely mis-read. Yes that makes sense, will update. Cheers Jon