diff options
author | NeilBrown <neilb@suse.de> | 2010-08-08 07:18:03 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-08-08 07:21:27 -0400 |
commit | bb4f1e9d0e2ef93de8e36ca0f5f26625fcd70b7d (patch) | |
tree | 7c7edc0d5fa2b5702358f11396d52d07183708c0 /drivers/md/md.h | |
parent | 147e0b6a639ac581ca3bf627bedc3f4a6d3eca66 (diff) |
md: fix another deadlock with removing sysfs attributes.
Move the deletion of sysfs attributes from reconfig_mutex to
open_mutex didn't really help as a process can try to take
open_mutex while holding reconfig_mutex, so the same deadlock can
happen, just requiring one more process to be involved in the chain.
I looks like I cannot easily use locking to wait for the sysfs
deletion to complete, so don't.
The only things that we cannot do while the deletions are still
pending is other things which can change the sysfs namespace: run,
takeover, stop. Each of these can fail with -EBUSY.
So set a flag while doing a sysfs deletion, and fail run, takeover,
stop if that flag is set.
This is suitable for 2.6.35.x
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index cccbadb31bae..6f797eceae31 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -145,6 +145,10 @@ struct mddev_s | |||
145 | int suspended; | 145 | int suspended; |
146 | atomic_t active_io; | 146 | atomic_t active_io; |
147 | int ro; | 147 | int ro; |
148 | int sysfs_active; /* set when sysfs deletes | ||
149 | * are happening, so run/ | ||
150 | * takeover/stop are not safe | ||
151 | */ | ||
148 | 152 | ||
149 | struct gendisk *gendisk; | 153 | struct gendisk *gendisk; |
150 | 154 | ||