FROMLIST: mmc: block: fix ABI regression of mmc_blk_ioctl
authorShawn Lin <shawn.lin@rock-chips.com>
Wed, 16 Mar 2016 10:15:47 +0000 (18:15 +0800)
committerJohn Stultz <john.stultz@linaro.org>
Thu, 17 Mar 2016 22:23:22 +0000 (15:23 -0700)
commit13c44727fb66fc1d57eb716a2225daaa4bd200e0
tree0917ec92a6dab3f408f16b49509cf82987e16e78
parentb471fcdaec3d419ddcbe416568f3f9ce7f1e9ef8
FROMLIST: mmc: block: fix ABI regression of mmc_blk_ioctl

If mmc_blk_ioctl returns -EINVAL, blkdev_ioctl continues to
work without returning err to user-space. But now we check
CAP_SYS_RAWIO firstly, so we return -EPERM to blkdev_ioctl,
which make blkdev_ioctl return -EPERM to user-space directly.
So this will break all the ioctl with BLKROSET. Now we find
Android-adb suffer it for the following log:

remount of /system failed;
couldn't make block device writable: Operation not permitted
openat(AT_FDCWD, "/dev/block/platform/ff420000.dwmmc/by-name/system", O_RDONLY) = 3
ioctl(3, BLKROSET, 0)  = -1 EPERM (Operation not permitted)

Fixes: a5f5774c55a2 ("mmc: block: Add new ioctl to send multi commands")
Change-Id: Ie9ba728e366abf4ab73fd6102d2a2aa0d4ee5c66
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/mmc/card/block.c