Re: [PATCH v3 04/11] md/raid5-cache: Take mddev_lock in r5c_journal_mode_show()
From: Christoph Hellwig <hch@infradead.org>
Date: 2022-06-03 06:40:18
Also in:
lkml
From: Christoph Hellwig <hch@infradead.org>
Date: 2022-06-03 06:40:18
Also in:
lkml
On Thu, Jun 02, 2022 at 12:18:10PM -0600, Logan Gunthorpe wrote:
conf = mddev->private; if (!conf || !conf->log) { - spin_unlock(&mddev->lock); + mddev_unlock(mddev); return 0; }@@ -2557,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) default: ret = 0; } - spin_unlock(&mddev->lock); + mddev_unlock(mddev); return ret;
Using a goto out_unlock would be nice here to keep the critical sections simple. But even as-is this looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
+ lockdep_assert_held(&conf->mddev->reconfig_mutex); +
.. but this looks unrelated and misplaced in this patch.