Commit 01b5d32a authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Song Liu

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: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent b3db8a21
...@@ -2537,13 +2537,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) ...@@ -2537,13 +2537,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
struct r5conf *conf; struct r5conf *conf;
int ret; int ret;
ret = mddev_lock(mddev); spin_lock(&mddev->lock);
if (ret)
return ret;
conf = mddev->private; conf = mddev->private;
if (!conf || !conf->log) { if (!conf || !conf->log) {
mddev_unlock(mddev); spin_unlock(&mddev->lock);
return 0; return 0;
} }
...@@ -2563,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) ...@@ -2563,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
default: default:
ret = 0; ret = 0;
} }
mddev_unlock(mddev); spin_unlock(&mddev->lock);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment