Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966706AbcCPNtl (ORCPT ); Wed, 16 Mar 2016 09:49:41 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35143 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964964AbcCPNtj (ORCPT ); Wed, 16 Mar 2016 09:49:39 -0400 Subject: Re: [PATCH] mmc: block: remove the check for whole block device for ioctl. To: Jon Hunter , Christoph Hellwig References: <1458055567-27878-1-git-send-email-fengwei.yin@linaro.org> <20160315143101.GA19497@infradead.org> <56E89E75.3080001@linaro.org> <56E947F8.2040105@nvidia.com> Cc: ulf.hansson@linaro.org, linux-kernel@vger.kernel.org From: "fengwei.yin" Message-ID: <56E9646F.5080307@linaro.org> Date: Wed, 16 Mar 2016 21:49:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56E947F8.2040105@nvidia.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1416 Lines: 47 On 2016/3/16 19:48, Jon Hunter wrote: > > On 15/03/16 23:44, fengwei.yin wrote: >> >> >> On 2016/3/15 22:31, Christoph Hellwig wrote: >>> On Tue, Mar 15, 2016 at 11:26:07AM -0400, Yin, Fengwei wrote: >>>> From: Fengwei Yin >>>> >>>> a5f5774c55a2e3ed75f4d6c5556b7bfcb726e6f0 introduced the whole block >>>> device checking for MMC_IOC_CMD while the old code has no such check. >>>> >>>> It breaks some ioctl call like BLKROSET from user space. An example >>>> is "adb remount" cmd. It prints out following error message: >>>> "remount of /system failed; couldn't make block device XXXX writable: \ >>>> Operation not permitted." >>>> while the command worked fine. >>>> >>>> This change move the whole block device checking only for >>>> MMC_IOC_MULTI_CMD. >>> >>> I think mmc_blk_ioctl_cmd will need this as well, as will probably >>> do any new ioctl. >>> >>> So I think the right fix is to simply return -EINVAL instead of >>> EPERM if on a partition, which will make all the block layer ioctls >>> works fine. >> Fair enough. >> >> I will wait for one more day for further comments to the patch. And update >> the patch tomorrow. Thanks a lot for looking into the patch. > > There is already a patch in the works for this [0]. > > Cheers > Jon > > [0] http://marc.info/?l=linux-mmc&m=145812340114153&w=2 Thanks a lot for the information. I will drop my patch. Regards Yin, Fengwei >