aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b2d8813ed716..292dad31d5e5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1807,10 +1807,19 @@ md_mismatches = __ATTR_RO(mismatch_cnt);
1807static struct attribute *md_default_attrs[] = { 1807static struct attribute *md_default_attrs[] = {
1808 &md_level.attr, 1808 &md_level.attr,
1809 &md_raid_disks.attr, 1809 &md_raid_disks.attr,
1810 NULL,
1811};
1812
1813static struct attribute *md_redundancy_attrs[] = {
1810 &md_scan_mode.attr, 1814 &md_scan_mode.attr,
1811 &md_mismatches.attr, 1815 &md_mismatches.attr,
1812 NULL, 1816 NULL,
1813}; 1817};
1818static struct attribute_group md_redundancy_group = {
1819 .name = NULL,
1820 .attrs = md_redundancy_attrs,
1821};
1822
1814 1823
1815static ssize_t 1824static ssize_t
1816md_attr_show(struct kobject *kobj, struct attribute *attr, char *page) 1825md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
@@ -2047,6 +2056,8 @@ static int do_md_run(mddev_t * mddev)
2047 bitmap_destroy(mddev); 2056 bitmap_destroy(mddev);
2048 return err; 2057 return err;
2049 } 2058 }
2059 if (mddev->pers->sync_request)
2060 sysfs_create_group(&mddev->kobj, &md_redundancy_group);
2050 atomic_set(&mddev->writes_pending,0); 2061 atomic_set(&mddev->writes_pending,0);
2051 mddev->safemode = 0; 2062 mddev->safemode = 0;
2052 mddev->safemode_timer.function = md_safemode_timeout; 2063 mddev->safemode_timer.function = md_safemode_timeout;
@@ -2155,6 +2166,9 @@ static int do_md_stop(mddev_t * mddev, int ro)
2155 set_disk_ro(disk, 0); 2166 set_disk_ro(disk, 0);
2156 blk_queue_make_request(mddev->queue, md_fail_request); 2167 blk_queue_make_request(mddev->queue, md_fail_request);
2157 mddev->pers->stop(mddev); 2168 mddev->pers->stop(mddev);
2169 if (mddev->pers->sync_request)
2170 sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
2171
2158 module_put(mddev->pers->owner); 2172 module_put(mddev->pers->owner);
2159 mddev->pers = NULL; 2173 mddev->pers = NULL;
2160 if (mddev->ro) 2174 if (mddev->ro)