diff options
-rw-r--r-- | drivers/md/md.c | 2 | ||||
-rw-r--r-- | include/linux/mutex.h | 2 | ||||
-rw-r--r-- | kernel/mutex.c | 9 |
3 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index d2bcb410e3ab..3ce7a5d81d81 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4423,7 +4423,7 @@ static int md_open(struct inode *inode, struct file *file) | |||
4423 | mddev_t *mddev = inode->i_bdev->bd_disk->private_data; | 4423 | mddev_t *mddev = inode->i_bdev->bd_disk->private_data; |
4424 | int err; | 4424 | int err; |
4425 | 4425 | ||
4426 | if ((err = mddev_lock(mddev))) | 4426 | if ((err = mutex_lock_interruptible_nested(&mddev->reconfig_mutex, 1))) |
4427 | goto out; | 4427 | goto out; |
4428 | 4428 | ||
4429 | err = 0; | 4429 | err = 0; |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index b2b91c477563..a7544afd7582 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -125,8 +125,10 @@ extern int fastcall mutex_lock_interruptible(struct mutex *lock); | |||
125 | 125 | ||
126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
128 | extern int mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass); | ||
128 | #else | 129 | #else |
129 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 130 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
131 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | ||
130 | #endif | 132 | #endif |
131 | 133 | ||
132 | /* | 134 | /* |
diff --git a/kernel/mutex.c b/kernel/mutex.c index 8c71cf72a497..e7cbbb82765b 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c | |||
@@ -206,6 +206,15 @@ mutex_lock_nested(struct mutex *lock, unsigned int subclass) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | EXPORT_SYMBOL_GPL(mutex_lock_nested); | 208 | EXPORT_SYMBOL_GPL(mutex_lock_nested); |
209 | |||
210 | int __sched | ||
211 | mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass) | ||
212 | { | ||
213 | might_sleep(); | ||
214 | return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, subclass); | ||
215 | } | ||
216 | |||
217 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); | ||
209 | #endif | 218 | #endif |
210 | 219 | ||
211 | /* | 220 | /* |