aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Obitotskiy <aleksey.obitotskiy@intel.com>2016-06-23 06:11:01 -0400
committerShaohua Li <shli@fb.com>2016-07-19 14:17:31 -0400
commit4cb9da7d9c631514effa5e806f9de7c7c746c3a8 (patch)
tree077f8129fd8276ec965e537326b53bea2d2bfeec
parent0e3ef49eda5bae3aa75aa8c0276411bf0f27e03a (diff)
Fix kernel module refcount handling
md loads raidX modules and increments module refcount each time level has changed but does not decrement it. You are unable to unload raid0 module after reshape because raid0 reshape changes level to raid4 and back to raid0. Signed-off-by: Aleksey Obitotskiy <aleksey.obitotskiy@intel.com> Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r--drivers/md/md.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4b8a264e9777..29297e97cdea 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3579,6 +3579,8 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
3579 mddev->to_remove = &md_redundancy_group; 3579 mddev->to_remove = &md_redundancy_group;
3580 } 3580 }
3581 3581
3582 module_put(oldpers->owner);
3583
3582 rdev_for_each(rdev, mddev) { 3584 rdev_for_each(rdev, mddev) {
3583 if (rdev->raid_disk < 0) 3585 if (rdev->raid_disk < 0)
3584 continue; 3586 continue;