ext2fs_dblist_iterate breaks its iteration loop if callback's return value has set DBLIST_ABORT bit. If ext2fs_dblist_iterate is called by ext2fs_dblist_dir_iterate, the callback is db_dir_proc->ext2fs_process_dir_block, which returns BLOCK_ABORT if something goes wrong. BLOCK_ABORT is defined as 2, whereas DBLIST_ABORT is 1. As result ext2fs_dblist_iterate does not break the iteration loop when ext2fs_process_dir_block returns BLOCK_ABORT. diff -puN lib/ext2fs/dblist.c~break-dblist-loop lib/ext2fs/dblist.c --- e2fsprogs-1.40.2/lib/ext2fs/dblist.c~break-dblist-loop 2007-09-22 03:13:22.000000000 +0300 +++ e2fsprogs-1.40.2-plodder/lib/ext2fs/dblist.c 2007-09-22 03:13:22.000000000 +0300 @@ -232,7 +232,7 @@ errcode_t ext2fs_dblist_iterate(ext2_dbl ext2fs_dblist_sort(dblist, 0); for (i=0; i < dblist->count; i++) { ret = (*func)(dblist->fs, &dblist->list[(int)i], priv_data); - if (ret & DBLIST_ABORT) + if ((ret & DBLIST_ABORT) || (ret == BLOCK_ABORT)) return 0; } return 0; _