aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-01-20 10:02:58 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-01-21 20:49:00 -0500
commitd8b79b2f94600262fcfbffbe3df7fd3c83c6c51b (patch)
treecfb822b441a239f0b94fc96042b7d4a11043c747 /fs
parent9af45ef5ab8ce4a13c553200dc15509441fbd68f (diff)
f2fs: use _safe() version of list_for_each
This is calling list_del() inside a loop which is a problem when we try move to the next item on the list. I've converted it to use the _safe version. And also, as a cleanup, I've converted it to use list_for_each_entry instead of list_for_each. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/recovery.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 6cc046d36815..f42e4060b399 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -173,10 +173,9 @@ out:
173static void destroy_fsync_dnodes(struct f2fs_sb_info *sbi, 173static void destroy_fsync_dnodes(struct f2fs_sb_info *sbi,
174 struct list_head *head) 174 struct list_head *head)
175{ 175{
176 struct list_head *this; 176 struct fsync_inode_entry *entry, *tmp;
177 struct fsync_inode_entry *entry; 177
178 list_for_each(this, head) { 178 list_for_each_entry_safe(entry, tmp, head, list) {
179 entry = list_entry(this, struct fsync_inode_entry, list);
180 iput(entry->inode); 179 iput(entry->inode);
181 list_del(&entry->list); 180 list_del(&entry->list);
182 kmem_cache_free(fsync_entry_slab, entry); 181 kmem_cache_free(fsync_entry_slab, entry);