[PATCH RFC 2/2] Revert "libblkid: check for private DM device before open"

[email protected] Wed, 8 Apr 2026 12:35:26 +0200
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
From: Carlos Maiolino <[email protected]>

This reverts commit d05a84b22e549527cbcbcc7d5efc6bad06668170.

Signed-off-by: Carlos Maiolino <[email protected]>
---
 libblkid/src/probe.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index d47c22c72043..60af2915c0d7 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -216,18 +216,8 @@ blkid_probe blkid_new_probe_from_filename(const char *filename)
 {
 	int fd;
 	blkid_probe pr = NULL;
-	struct stat sb;
-
-	/*
-	 * Check for private device-mapper devices (LVM internals, etc.)
-	 * before open() to avoid bumping the kernel open count.  A racing
-	 * DM_DEVICE_REMOVE would otherwise see EBUSY.
-	 */
-	if (stat(filename, &sb) == 0 && S_ISBLK(sb.st_mode) &&
-	    sysfs_devno_is_dm_private(sb.st_rdev, NULL))
-		return NULL;
 
-	fd = open(filename, O_RDONLY | O_CLOEXEC | O_NONBLOCK);
+	fd = open(filename, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
 	if (fd < 0)
 		return NULL;
 
-- 
2.53.0