浏览代码

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>
Alexey Obitotskiy 9 年之前
父节点
当前提交
4cb9da7d9c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/md/md.c

+ 2 - 0
drivers/md/md.c

@@ -3579,6 +3579,8 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
 			mddev->to_remove = &md_redundancy_group;
 			mddev->to_remove = &md_redundancy_group;
 	}
 	}
 
 
+	module_put(oldpers->owner);
+
 	rdev_for_each(rdev, mddev) {
 	rdev_for_each(rdev, mddev) {
 		if (rdev->raid_disk < 0)
 		if (rdev->raid_disk < 0)
 			continue;
 			continue;