common/module: fix patient module remover when module is not present
authorLuis Chamberlain <mcgrof@kernel.org>
Mon, 15 Nov 2021 23:28:34 +0000 (15:28 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Dec 2021 14:24:08 +0000 (22:24 +0800)
When module is not present and the open coded patient module
remover is called we'll end up in a loop which never ends.
Fix this.

I actually found this issue not in fstests, but when applying this
open coded solution to blktests. In fstest we tend to only call
module remove when we have a module loaded. blktests is different,
and so I immediately spotted the issue there.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/module

index ead0f881acae8ee0a55f07f8b3d90e107abe8c9e..6efab71d348e8ad9c49313c04e74a31f3d49ac24 100644 (file)
@@ -180,6 +180,8 @@ _patient_rmmod()
                                continue
                        fi
                        let max_tries=$max_tries-1
+               else
+                       break
                fi
        done