From: "Vladimir V. Saveliev" <vs@clusterfs.com>
To: ext4 <linux-ext4@vger.kernel.org>
Subject: [RFC] [PATCH] e2fsprogs: dblist iteration loop is unbreakable
Date: Sat, 22 Sep 2007 03:24:48 +0300 [thread overview]
Message-ID: <46F460D0.9020605@clusterfs.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: break-dblist-loop.patch --]
[-- Type: text/x-patch, Size: 1007 bytes --]
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;
_
next reply other threads:[~2007-09-21 23:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-22 0:24 Vladimir V. Saveliev [this message]
2007-09-23 15:40 ` [RFC] [PATCH] e2fsprogs: dblist iteration loop is unbreakable Theodore Tso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46F460D0.9020605@clusterfs.com \
--to=vs@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.