[PATCH] Fix kernel module refcount handling

From
Alexey Obitotskiy <hidden>
Date
2016-06-23 10:11:01
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 <redacted>
---
 drivers/md/md.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0963edc..c515e76 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3590,6 +3590,8 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
 			mddev->to_remove = &md_redundancy_group;
 	}
 
+	module_put(oldpers->owner);
+
 	rdev_for_each(rdev, mddev) {
 		if (rdev->raid_disk < 0)
 			continue;
-- 
2.7.4
Thread (2 messages) 2 messages, 2 authors, last reply 2016-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help