linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix kernel module refcount handling
@ 2016-06-23 10:11 Alexey Obitotskiy
  2016-07-19 18:21 ` Shaohua Li
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Obitotskiy @ 2016-06-23 10:11 UTC (permalink / raw)
  To: linux-raid; +Cc: shli, Aleksey Obitotskiy

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix kernel module refcount handling
  2016-06-23 10:11 [PATCH] Fix kernel module refcount handling Alexey Obitotskiy
@ 2016-07-19 18:21 ` Shaohua Li
  0 siblings, 0 replies; 2+ messages in thread
From: Shaohua Li @ 2016-07-19 18:21 UTC (permalink / raw)
  To: Alexey Obitotskiy; +Cc: linux-raid

On Thu, Jun 23, 2016 at 12:11:01PM +0200, Alexey Obitotskiy wrote:
> 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>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-19 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-23 10:11 [PATCH] Fix kernel module refcount handling Alexey Obitotskiy
2016-07-19 18:21 ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).