Skip to contentSkip to conversation

check: Suppress kmemleak scanning failures

PATCH In review Bart Van Assche 2 participants 2 messages Mar 23 – Mar 31 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check: Suppress kmemleak scanning failures

kmemleak disables itself if an internal error has been encountered. If this happens, any attempt to write into /sys/kernel/debug/kmemleak triggers the error "Operation not permitted". Suppress this error message instead of displaying it on stdout.

---
 check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
check +1 -1
index f170458fdb69..d2232828a9e3 100755
@@ -233,7 +233,7 @@ _check_kmemleak() {
 
 	((KMEMLEAK)) || return 0
 
-	echo scan > "$KMEMLEAK_FILE"
+	{ echo scan > "$KMEMLEAK_FILE"; } 2>/dev/null || return 0
 	sleep 1
 	kmemleak=$(cat "$KMEMLEAK_FILE")
 
#1 lore raw
Quoted 6 lines · Bart Van Assche

kmemleak disables itself if an internal error has been encountered. If this happens, any attempt to write into /sys/kernel/debug/kmemleak triggers the error "Operation not permitted". Suppress this error message instead of displaying it on stdout.

Thanks, I applied this patch.