All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: fstests@vger.kernel.org
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH] common/module: fix patient module remover when module is not present
Date: Mon, 15 Nov 2021 15:28:34 -0800	[thread overview]
Message-ID: <20211115232834.4121190-1-mcgrof@kernel.org> (raw)

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>
---
 common/module | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/module b/common/module
index ead0f881..6efab71d 100644
--- a/common/module
+++ b/common/module
@@ -180,6 +180,8 @@ _patient_rmmod()
 				continue
 			fi
 			let max_tries=$max_tries-1
+		else
+			break
 		fi
 	done
 
-- 
2.33.0


             reply	other threads:[~2021-11-16  2:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 23:28 Luis Chamberlain [this message]
2021-12-10 19:55 ` [PATCH] common/module: fix patient module remover when module is not present Luis Chamberlain
2021-12-12 12:59   ` Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211115232834.4121190-1-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.