FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Luís Henriques" <lhenriques@suse.de>
To: fstests@vger.kernel.org
Cc: "Luís Henriques" <lhenriques@suse.de>
Subject: [PATCH] common/rc: cleanup old .kmemleak files
Date: Wed, 12 Jul 2023 15:51:01 +0100	[thread overview]
Message-ID: <20230712145101.4286-1-lhenriques@suse.de> (raw)

I've spent a non-negligible amount of time looking into a kmemleak that
didn't exist in the code I was testing because there was an old .kmemleak
file in the results directory.  I don't think this is an intended behaviour,
so I'm proposing to remove these files everytime we capture the result of a
new scan.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
 common/rc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/rc b/common/rc
index 741579af82d2..6aa6be704e51 100644
--- a/common/rc
+++ b/common/rc
@@ -4433,6 +4433,8 @@ _capture_kmemleak()
 	local kern_knob="$DEBUGFS_MNT/kmemleak"
 	local leak_file="$1"
 
+	rm -f "$leak_file"
+
 	# Tell the kernel to scan for memory leaks.  Apparently the write
 	# returns before the scan is complete, so do it twice in the hopes
 	# that twice is enough to capture all the leaks.

             reply	other threads:[~2023-07-12 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 14:51 Luís Henriques [this message]
2023-07-12 16:32 ` [PATCH] common/rc: cleanup old .kmemleak files Darrick J. Wong
2023-07-12 16:35 ` [PATCH v2] " Luís Henriques
2023-07-12 22:06   ` Darrick J. Wong
2023-07-13  8:23     ` Luís Henriques
2023-07-13 14:04       ` Darrick J. Wong

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=20230712145101.4286-1-lhenriques@suse.de \
    --to=lhenriques@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox