summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index e6d3d88698ed..ac84289664cd 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -735,8 +735,8 @@ static inline int mddev_trylock(struct mddev *mddev)
int ret;
ret = mutex_trylock(&mddev->reconfig_mutex);
- if (!ret && test_bit(MD_DELETED, &mddev->flags)) {
- ret = -ENODEV;
+ if (ret && test_bit(MD_DELETED, &mddev->flags)) {
+ ret = 0;
mutex_unlock(&mddev->reconfig_mutex);
}
return ret;