lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 20 Jun 2008 22:32:49 -0500
From:	Eric Sandeen <>
To:	ext4 development <>
CC:	Theodore Tso <>
Subject: [PATCH blkid] use list_for_each_safe in garbage collection

We need to use list_for_each_safe in case a device gets removed
from the list during garbage collection.

Also make the manpage slightly more informative about
what the -g garbage collection option does.

Signed-off-by: Eric Sandeen <>

Index: e2fsprogs-1.41/lib/blkid/cache.c
--- e2fsprogs-1.41.orig/lib/blkid/cache.c
+++ e2fsprogs-1.41/lib/blkid/cache.c
@@ -154,13 +154,13 @@ void blkid_put_cache(blkid_cache cache)
 void blkid_gc_cache(blkid_cache cache)
-	struct list_head *p;
+	struct list_head *p, *pnext;
 	struct stat st;
 	if (!cache)
-	list_for_each(p, &cache->bic_devs) {
+	list_for_each_safe(p, pnext, &cache->bic_devs) {
 		blkid_dev dev = list_entry(p, struct blkid_struct_dev, bid_devs);
 		if (!p)
Index: e2fsprogs-1.41/misc/
--- e2fsprogs-1.41.orig/misc/
+++ e2fsprogs-1.41/misc/
@@ -61,7 +61,8 @@ scanned but not necessarily available at
 .IR /dev/null.
 .B \-g
-Perform a garbage collection pass on the blkid cache.
+Perform a garbage collection pass on the blkid cache to remove
+devices which no longer exist.
 .B \-h
 Display a usage message and exit.

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists