Skip to content

Commit 01b5d32

Browse files
Guoqing Jiangliu-song-6
authored andcommitted
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>
1 parent b3db8a2 commit 01b5d32

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/md/raid5-cache.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,13 +2537,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
25372537
struct r5conf *conf;
25382538
int ret;
25392539

2540-
ret = mddev_lock(mddev);
2541-
if (ret)
2542-
return ret;
2543-
2540+
spin_lock(&mddev->lock);
25442541
conf = mddev->private;
25452542
if (!conf || !conf->log) {
2546-
mddev_unlock(mddev);
2543+
spin_unlock(&mddev->lock);
25472544
return 0;
25482545
}
25492546

@@ -2563,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
25632560
default:
25642561
ret = 0;
25652562
}
2566-
mddev_unlock(mddev);
2563+
spin_unlock(&mddev->lock);
25672564
return ret;
25682565
}
25692566

0 commit comments

Comments
 (0)