diff options
-rw-r--r-- | drivers/md/md.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f47f1f8ac44b..004d8e5b2a57 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6054,8 +6054,15 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, | |||
6054 | struct mddev *mddev = NULL; | 6054 | struct mddev *mddev = NULL; |
6055 | int ro; | 6055 | int ro; |
6056 | 6056 | ||
6057 | if (!capable(CAP_SYS_ADMIN)) | 6057 | switch (cmd) { |
6058 | return -EACCES; | 6058 | case RAID_VERSION: |
6059 | case GET_ARRAY_INFO: | ||
6060 | case GET_DISK_INFO: | ||
6061 | break; | ||
6062 | default: | ||
6063 | if (!capable(CAP_SYS_ADMIN)) | ||
6064 | return -EACCES; | ||
6065 | } | ||
6059 | 6066 | ||
6060 | /* | 6067 | /* |
6061 | * Commands dealing with the RAID driver but not any | 6068 | * Commands dealing with the RAID driver but not any |