aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1ed5152db450..d7316b829a62 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -163,6 +163,7 @@ void md_new_event(mddev_t *mddev)
163{ 163{
164 atomic_inc(&md_event_count); 164 atomic_inc(&md_event_count);
165 wake_up(&md_event_waiters); 165 wake_up(&md_event_waiters);
166 sysfs_notify(&mddev->kobj, NULL, "sync_action");
166} 167}
167EXPORT_SYMBOL_GPL(md_new_event); 168EXPORT_SYMBOL_GPL(md_new_event);
168 169
@@ -278,11 +279,6 @@ static inline int mddev_lock(mddev_t * mddev)
278 return mutex_lock_interruptible(&mddev->reconfig_mutex); 279 return mutex_lock_interruptible(&mddev->reconfig_mutex);
279} 280}
280 281
281static inline void mddev_lock_uninterruptible(mddev_t * mddev)
282{
283 mutex_lock(&mddev->reconfig_mutex);
284}
285
286static inline int mddev_trylock(mddev_t * mddev) 282static inline int mddev_trylock(mddev_t * mddev)
287{ 283{
288 return mutex_trylock(&mddev->reconfig_mutex); 284 return mutex_trylock(&mddev->reconfig_mutex);
@@ -2457,9 +2453,11 @@ md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
2457 2453
2458 if (!entry->show) 2454 if (!entry->show)
2459 return -EIO; 2455 return -EIO;
2460 mddev_lock(mddev); 2456 rv = mddev_lock(mddev);
2461 rv = entry->show(mddev, page); 2457 if (!rv) {
2462 mddev_unlock(mddev); 2458 rv = entry->show(mddev, page);
2459 mddev_unlock(mddev);
2460 }
2463 return rv; 2461 return rv;
2464} 2462}
2465 2463
@@ -2473,9 +2471,11 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
2473 2471
2474 if (!entry->store) 2472 if (!entry->store)
2475 return -EIO; 2473 return -EIO;
2476 mddev_lock(mddev); 2474 rv = mddev_lock(mddev);
2477 rv = entry->store(mddev, page, length); 2475 if (!rv) {
2478 mddev_unlock(mddev); 2476 rv = entry->store(mddev, page, length);
2477 mddev_unlock(mddev);
2478 }
2479 return rv; 2479 return rv;
2480} 2480}
2481 2481
@@ -4340,8 +4340,9 @@ static int md_seq_show(struct seq_file *seq, void *v)
4340 return 0; 4340 return 0;
4341 } 4341 }
4342 4342
4343 if (mddev_lock(mddev)!=0) 4343 if (mddev_lock(mddev) < 0)
4344 return -EINTR; 4344 return -EINTR;
4345
4345 if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) { 4346 if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) {
4346 seq_printf(seq, "%s : %sactive", mdname(mddev), 4347 seq_printf(seq, "%s : %sactive", mdname(mddev),
4347 mddev->pers ? "" : "in"); 4348 mddev->pers ? "" : "in");