Skip to contentSkip to conversation

common/module: fix patient module remover when module is not present

PATCH In review Luis Chamberlain 2 participants 3 messages Nov 16, 2021 – Dec 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/module: fix patient module remover when module is not present

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.

---
 common/module | 2 ++
 1 file changed, 2 insertions(+)
common/module +2 -0
index ead0f881..6efab71d 100644
@@ -180,6 +180,8 @@ _patient_rmmod()
 				continue
 			fi
 			let max_tries=$max_tries-1
+		else
+			break
 		fi
 	done
 
Signature · 1 line
2.33.0
#1 lore raw

Poke

Quoted 30 lines · Luis Chamberlain

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.

---
 common/module | 2 ++
 1 file changed, 2 insertions(+)
common/module +2 -0
index ead0f881..6efab71d 100644
@@ -180,6 +180,8 @@ _patient_rmmod()
 				continue
 			fi
 			let max_tries=$max_tries-1
+		else
+			break
 		fi
 	done
 
Signature · 1 line
2.33.0
#2 lore raw
Quoted 1 line · Luis Chamberlain

Poke

Sorry, it got lost from my to-review queue, applied now, thanks!

Eryu

Quoted 32 lines · Luis Chamberlain
Quoted 30 lines

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.

---
 common/module | 2 ++
 1 file changed, 2 insertions(+)
common/module +2 -0
index ead0f881..6efab71d 100644
@@ -180,6 +180,8 @@ _patient_rmmod()
 				continue
 			fi
 			let max_tries=$max_tries-1
+		else
+			break
 		fi
 	done
 
Signature · 1 line
2.33.0