summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-13 22:08:01 +0800
committerDavid Sterba <dsterba@suse.com>2016-01-15 19:27:18 +0100
commit8e217858eea0d63de9d818f52fa98b5f9e502e5a (patch)
treef4ca90c0db88a119e42c8ee4a703c6bef07c448d /fs/btrfs/backref.c
parent95617d69326ce386c95e33db7aeb832b45ee9f8f (diff)
downloadlinux-8e217858eea0d63de9d818f52fa98b5f9e502e5a.tar.gz
linux-8e217858eea0d63de9d818f52fa98b5f9e502e5a.tar.bz2
linux-8e217858eea0d63de9d818f52fa98b5f9e502e5a.zip
btrfs: fix iterator with update error in backref.c
Fix the following error: fs/btrfs/backref.c:565:1-20: iterator with update on line 577 Fixes: a7ca422('btrfs: use list_for_each_entry* in backref.c') Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 08405a3da6b1..b90cd3776f8e 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -560,13 +560,13 @@ static int __add_missing_keys(struct btrfs_fs_info *fs_info,
*/
static void __merge_refs(struct list_head *head, int mode)
{
- struct __prelim_ref *ref1;
+ struct __prelim_ref *pos1;
- list_for_each_entry(ref1, head, list) {
- struct __prelim_ref *ref2 = ref1, *tmp;
+ list_for_each_entry(pos1, head, list) {
+ struct __prelim_ref *pos2 = pos1, *tmp;
- list_for_each_entry_safe_continue(ref2, tmp, head, list) {
- struct __prelim_ref *xchg;
+ list_for_each_entry_safe_continue(pos2, tmp, head, list) {
+ struct __prelim_ref *xchg, *ref1 = pos1, *ref2 = pos2;
struct extent_inode_elem *eie;
if (!ref_for_same_block(ref1, ref2))