[PATCH 3/3] md: remove/add redundancy group only in level change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



del_gendisk is called in synchronous way now. So it doesn't need to handle
redundancy group separately.

Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 drivers/md/md.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0913b8236471..84cd21bd85b0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -818,23 +818,16 @@ void mddev_unlock(struct mddev *mddev)
 		mddev->sysfs_active = 1;
 		mutex_unlock(&mddev->reconfig_mutex);
 
-		if (mddev->kobj.sd) {
-			if (to_remove != &md_redundancy_group)
-				sysfs_remove_group(&mddev->kobj, to_remove);
-			if (mddev->pers == NULL ||
-			    mddev->pers->sync_request == NULL) {
-				sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
-				if (mddev->sysfs_action)
-					sysfs_put(mddev->sysfs_action);
-				if (mddev->sysfs_completed)
-					sysfs_put(mddev->sysfs_completed);
-				if (mddev->sysfs_degraded)
-					sysfs_put(mddev->sysfs_degraded);
-				mddev->sysfs_action = NULL;
-				mddev->sysfs_completed = NULL;
-				mddev->sysfs_degraded = NULL;
-			}
-		}
+		sysfs_remove_group(&mddev->kobj, to_remove);
+		if (mddev->sysfs_action)
+			sysfs_put(mddev->sysfs_action);
+		if (mddev->sysfs_completed)
+			sysfs_put(mddev->sysfs_completed);
+		if (mddev->sysfs_degraded)
+			sysfs_put(mddev->sysfs_degraded);
+		mddev->sysfs_action = NULL;
+		mddev->sysfs_completed = NULL;
+		mddev->sysfs_degraded = NULL;
 		mddev->sysfs_active = 0;
 	} else
 		mutex_unlock(&mddev->reconfig_mutex);
@@ -6475,8 +6468,6 @@ static void __md_stop(struct mddev *mddev)
 	if (mddev->private)
 		pers->free(mddev, mddev->private);
 	mddev->private = NULL;
-	if (pers->sync_request && mddev->to_remove == NULL)
-		mddev->to_remove = &md_redundancy_group;
 	put_pers(pers);
 	clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
 
-- 
2.32.0 (Apple Git-132)





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux