diff options
author | Guoqing Jiang <guoqing.jiang@cloud.ionos.com> | 2020-07-28 12:01:42 +0200 |
---|---|---|
committer | Song Liu <songliubraving@fb.com> | 2020-08-02 23:03:52 -0700 |
commit | 01b5d32a57fe83820d014485a4c41965bc3b5ce4 (patch) | |
tree | cddc4e9f014b815d95f62d7cfbd845f1a71a1c6a /drivers/md | |
parent | b3db8a216393cc228ab4add580f488da55177b66 (diff) | |
download | linux-01b5d32a57fe83820d014485a4c41965bc3b5ce4.tar.bz2 |
raid5-cache: hold spinlock instead of mutex in r5c_journal_mode_show
Replace mddev_lock with spin_lock to align with other show methods in
raid5_attrs.
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5-cache.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 82eb4a906e31..4337ae0e6af2 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -2537,13 +2537,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) struct r5conf *conf; int ret; - ret = mddev_lock(mddev); - if (ret) - return ret; - + spin_lock(&mddev->lock); conf = mddev->private; if (!conf || !conf->log) { - mddev_unlock(mddev); + spin_unlock(&mddev->lock); return 0; } @@ -2563,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) default: ret = 0; } - mddev_unlock(mddev); + spin_unlock(&mddev->lock); return ret; } |