aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c0da5eedc245..a5286beddcf5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1926,6 +1926,8 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
1926 1926
1927 if (!entry->store) 1927 if (!entry->store)
1928 return -EIO; 1928 return -EIO;
1929 if (!capable(CAP_SYS_ADMIN))
1930 return -EACCES;
1929 return entry->store(rdev, page, length); 1931 return entry->store(rdev, page, length);
1930} 1932}
1931 1933
@@ -2859,6 +2861,8 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
2859 2861
2860 if (!entry->store) 2862 if (!entry->store)
2861 return -EIO; 2863 return -EIO;
2864 if (!capable(CAP_SYS_ADMIN))
2865 return -EACCES;
2862 rv = mddev_lock(mddev); 2866 rv = mddev_lock(mddev);
2863 if (!rv) { 2867 if (!rv) {
2864 rv = entry->store(mddev, page, length); 2868 rv = entry->store(mddev, page, length);