From 0a5593875ac8927237dc4c92ddc13cef866eaf45 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 23 Jan 2024 20:02:14 +0300 Subject: [PATCH] LU-17459 lod: incorrect assert in lod_statfs_and_check() the assertion must be done once we're sure this target has not been counted/marked as active. Signed-off-by: Alex Zhuravlev Change-Id: I56ae3fad92b8518f6aba2c880ecdac55f53cb689 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53783 Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Alexander Zarochentsev Reviewed-by: Sergey Cheremencev Tested-by: jenkins Tested-by: Maloo --- lustre/lod/lod_qos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 8c9a468..8887d5f 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -131,10 +131,10 @@ static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d, } else if (rc == 0 && !tgt->ltd_active) { /* turned active? */ spin_lock(&d->lod_lock); - LASSERTF(desc->ld_active_tgt_count < desc->ld_tgt_count, - "active tgt count %d, tgt nr %d\n", - desc->ld_active_tgt_count, desc->ld_tgt_count); if (!tgt->ltd_active) { + LASSERTF(desc->ld_active_tgt_count < desc->ld_tgt_count, + "active tgt count %d, tgt nr %d\n", + desc->ld_active_tgt_count, desc->ld_tgt_count); tgt->ltd_active = 1; tgt->ltd_discon = 0; desc->ld_active_tgt_count++; -- 1.8.3.1