Whamcloud - gitweb
LU-17459 lod: incorrect assert in lod_statfs_and_check() 83/53783/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 23 Jan 2024 17:02:14 +0000 (20:02 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Feb 2024 07:10:40 +0000 (07:10 +0000)
the assertion must be done once we're sure this target
has not been counted/marked as active.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I56ae3fad92b8518f6aba2c880ecdac55f53cb689
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53783
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lod/lod_qos.c

index 8c9a468..8887d5f 100644 (file)
@@ -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++;