Skip to contentSkip to conversation

selftests-damon-check-correct-path-in-ensure_file-not_exist-case.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 5

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/damon: check correct path in ensure_file() not_exist case
has been removed from the -mm tree. Its filename was
selftests-damon-check-correct-path-in-ensure_file-not_exist-case.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: wang wei <[email protected]>
Subject: selftests/damon: check correct path in ensure_file() not_exist case
Date: Mon, 6 Jul 2026 21:43:04 +0800

In the ensure_file() function, the "not_exist" code path checks whether $dir exists as a regular file. However, the intent is to verify that the target file ($file) does not exist, not the $dir. Testing $dir makes the existence check effectively useless -- it tests the wrong path and thus never catches the case where the file is unexpectedly present.

Replace $dir with $file so the not_exist verification targets the correct path.

---

 tools/testing/selftests/damon/sysfs.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/damon/sysfs.sh renamed from tools/testing/selftests/damon/sysfs.sh~selftests-damon-check-correct-path-in-ensure_file-not_exist-case +1 -1
@@ -67,7 +67,7 @@ ensure_file()
 			echo "$file permission: expected $permission but $perm"
 			exit 1
 		fi
-	elif [ "$to_ensure" = "not_exist" ] && [ -f "$dir" ]
+	elif [ "$to_ensure" = "not_exist" ] && [ -f "$file" ]
 	then
 		echo "$file is not expected but found"
 		exit 1

_

Patches currently in -mm which might be from [email protected] are