Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1308440

[PATCH] btrfs: fix iterator with update error in backref.c

From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH] btrfs: fix iterator with update error in backref.c
Date 2016-01-13 15:10 +0100
Message-ID <qQuhA-Oj-29@gated-at.bofh.it> (permalink)
References <qQbHZ-4HB-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 fs/btrfs/backref.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 08405a3..b90cd37 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))
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [kdave:misc-cleanups-4.5 9/9] fs/btrfs/backref.c:565:1-20: iterator with update on line 577 Geliang Tang <geliangtang@163.com> - 2016-01-12 16:30 +0100
  [PATCH v3] btrfs: use list_for_each_entry* in backref.c Geliang Tang <geliangtang@163.com> - 2016-01-12 16:30 +0100
    Re: [PATCH v3] btrfs: use list_for_each_entry* in backref.c David Sterba <dsterba@suse.cz> - 2016-01-12 19:20 +0100
      [PATCH] btrfs: fix iterator with update error in backref.c Geliang Tang <geliangtang@163.com> - 2016-01-13 15:10 +0100

csiph-web