Skip to content

Commit

Permalink
md: allow non-privileged uses to GET_*_INFO about raid arrays.
Browse files Browse the repository at this point in the history
The info is already available in /proc/mdstat and /sys/block in
an accessible form so there is no point in putting a road-block in
the ioctl for information gathering.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Dec 22, 2011
1 parent 961902c commit 506c9e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -6054,8 +6054,15 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
struct mddev *mddev = NULL;
int ro;

if (!capable(CAP_SYS_ADMIN))
return -EACCES;
switch (cmd) {
case RAID_VERSION:
case GET_ARRAY_INFO:
case GET_DISK_INFO:
break;
default:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
}

/*
* Commands dealing with the RAID driver but not any
Expand Down

0 comments on commit 506c9e4

Please sign in to comment.