mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 08:01:12 +02:00
xfs: lock the healthmon when inserting unmount event
LOLLM complains that xfs_healthmon_unmount does an unlocked insert of
the unmount event into the health monitor's event list. Fix that.
Cc: stable@vger.kernel.org # v7.0
Fixes: 25ca57fa36 ("xfs: convey filesystem unmount events to the health monitor")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
9dd6cc92a7
commit
7538ba528c
|
|
@ -272,6 +272,8 @@ __xfs_healthmon_insert(
|
|||
{
|
||||
struct timespec64 now;
|
||||
|
||||
lockdep_assert_held(&hm->lock);
|
||||
|
||||
ktime_get_coarse_real_ts64(&now);
|
||||
event->time_ns = (now.tv_sec * NSEC_PER_SEC) + now.tv_nsec;
|
||||
|
||||
|
|
@ -294,6 +296,8 @@ __xfs_healthmon_push(
|
|||
{
|
||||
struct timespec64 now;
|
||||
|
||||
lockdep_assert_held(&hm->lock);
|
||||
|
||||
ktime_get_coarse_real_ts64(&now);
|
||||
event->time_ns = (now.tv_sec * NSEC_PER_SEC) + now.tv_nsec;
|
||||
|
||||
|
|
@ -415,8 +419,10 @@ xfs_healthmon_unmount(
|
|||
* There's nothing actionable for userspace after an unmount. Once
|
||||
* we've inserted the unmount event, hm no longer owns that event.
|
||||
*/
|
||||
mutex_lock(&hm->lock);
|
||||
__xfs_healthmon_insert(hm, hm->unmount_event);
|
||||
hm->unmount_event = NULL;
|
||||
mutex_unlock(&hm->lock);
|
||||
|
||||
xfs_healthmon_detach(hm);
|
||||
xfs_healthmon_put(hm);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user