diff options
author | Eric Sandeen <sandeen@redhat.com> | 2008-06-20 22:32:49 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-06-28 22:17:20 -0400 |
commit | 772b89d34212e4b36c2025c80304e166bc25a2f3 (patch) | |
tree | 9f05bcd1a31c588d312226f8ceb2e5cc8b0c2bb8 /lib | |
parent | bbf6d453597ff8227c9a541d55c64ba01691f171 (diff) | |
download | e2fsprogs-772b89d34212e4b36c2025c80304e166bc25a2f3.tar.gz |
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.
Addresses-Debian-Bug: #487758, #487783
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/blkid/cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c index 1508d0f8..efd4656e 100644 --- a/lib/blkid/cache.c +++ b/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) return; - 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) break; |