aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-23 10:17:26 +1100
committerNeilBrown <neilb@suse.de>2011-12-23 10:17:26 +1100
commit506c9e44a85f6a79fc0643f2d2498ab6cda3d3f8 (patch)
tree94dd7741a688b2c57494819ca3a22d228462ff98 /drivers/md/md.c
parentmd/bitmap: It is OK to clear bits during recovery. (diff)
downloadlinux-dev-506c9e44a85f6a79fc0643f2d2498ab6cda3d3f8.tar.xz
linux-dev-506c9e44a85f6a79fc0643f2d2498ab6cda3d3f8.zip
md: allow non-privileged uses to GET_*_INFO about raid arrays.
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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c11
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,
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