Skip to contentSkip to conversation

e2fsprogs: fix blkid detection of ext4dev as ext4

PATCH Applied Eric Sandeen 2 participants 2 messages Oct 8, 2008 – Oct 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsprogs: fix blkid detection of ext4dev as ext4

If only ext4 is available (as a module or in /proc/filesystems) blkid wasn't properly testing for it, because the time checks were backwards and always failed. This caused old ext4dev filesystems to fail to mount as ext4. With this patch it works fine.

---

lib/blkid/probe.c +2 -2
Index: e2fsprogs/lib/blkid/probe.c
===================================================================
@@ -243,7 +243,7 @@ static int system_supports_ext4(void)
 	static int	ret = -1;
 	time_t		now = time(0);
 
-	if (ret != -1 || (last_check - now) < 5)
+	if (ret != -1 || (now - last_check) < 5)
 		return ret;
 	last_check = now;
 	ret = (fs_proc_check("ext4") || check_for_modules("ext4"));
@@ -256,7 +256,7 @@ static int system_supports_ext4dev(void)
 	static int	ret = -1;
 	time_t		now = time(0);
 
-	if (ret != -1 || (last_check - now) < 5)
+	if (ret != -1 || (now - last_check) < 5)
 		return ret;
 	last_check = now;
 	ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));
Applied
#1 lore raw
Quoted 7 lines · Eric Sandeen

If only ext4 is available (as a module or in /proc/filesystems) blkid wasn't properly testing for it, because the time checks were backwards and always failed. This caused old ext4dev filesystems to fail to mount as ext4. With this patch it works fine.

thanks, applied.

- Ted