diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-11 10:28:19 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-11 10:28:19 -0500 |
commit | 734d1ece37fbf3d2ddfc71bc6c69e0fe35f02542 (patch) | |
tree | c4805dd7e746b1feb9e09e9849f3245d0b2c0c6b /fs/btrfs/backref.c | |
parent | 216c82c6aba63eeb49d7654b448e0d47bea255bb (diff) | |
parent | 9931faca02c604c22335f5a935a501bb2ace6e20 (diff) |
Merge tag 'v3.8-rc3' into v4l_for_linus
Linux 3.8-rc3
* tag 'v3.8-rc3': (11110 commits)
Linux 3.8-rc3
mm: reinstante dropped pmd_trans_splitting() check
cred: Remove tgcred pointer from struct cred
drm/ttm: fix fence locking in ttm_buffer_object_transfer
ARM: clps711x: Fix bad merge of clockevents setup
ARM: highbank: save and restore L2 cache and GIC on suspend
ARM: highbank: add a power request clear
ARM: highbank: fix secondary boot and hotplug
ARM: highbank: fix typos with hignbank in power request functions
ARM: dts: fix highbank cpu mpidr values
ARM: dts: add device_type prop to cpu nodes on Calxeda platforms
drm/prime: drop reference on imported dma-buf come from gem
xen/netfront: improve truesize tracking
ARM: mx5: Fix MX53 flexcan2 clock
ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array
sctp: fix Kconfig bug in default cookie hmac selection
EDAC: Cleanup device deregistering path
EDAC: Fix EDAC Kconfig menu
EDAC: Fix kernel panic on module unloading
ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
...
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 208d8aa5b07e..04edf69be875 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -461,6 +461,7 @@ static int __merge_refs(struct list_head *head, int mode) | |||
461 | pos2 = n2, n2 = pos2->next) { | 461 | pos2 = n2, n2 = pos2->next) { |
462 | struct __prelim_ref *ref2; | 462 | struct __prelim_ref *ref2; |
463 | struct __prelim_ref *xchg; | 463 | struct __prelim_ref *xchg; |
464 | struct extent_inode_elem *eie; | ||
464 | 465 | ||
465 | ref2 = list_entry(pos2, struct __prelim_ref, list); | 466 | ref2 = list_entry(pos2, struct __prelim_ref, list); |
466 | 467 | ||
@@ -472,12 +473,20 @@ static int __merge_refs(struct list_head *head, int mode) | |||
472 | ref1 = ref2; | 473 | ref1 = ref2; |
473 | ref2 = xchg; | 474 | ref2 = xchg; |
474 | } | 475 | } |
475 | ref1->count += ref2->count; | ||
476 | } else { | 476 | } else { |
477 | if (ref1->parent != ref2->parent) | 477 | if (ref1->parent != ref2->parent) |
478 | continue; | 478 | continue; |
479 | ref1->count += ref2->count; | ||
480 | } | 479 | } |
480 | |||
481 | eie = ref1->inode_list; | ||
482 | while (eie && eie->next) | ||
483 | eie = eie->next; | ||
484 | if (eie) | ||
485 | eie->next = ref2->inode_list; | ||
486 | else | ||
487 | ref1->inode_list = ref2->inode_list; | ||
488 | ref1->count += ref2->count; | ||
489 | |||
481 | list_del(&ref2->list); | 490 | list_del(&ref2->list); |
482 | kfree(ref2); | 491 | kfree(ref2); |
483 | } | 492 | } |
@@ -890,8 +899,7 @@ again: | |||
890 | while (!list_empty(&prefs)) { | 899 | while (!list_empty(&prefs)) { |
891 | ref = list_first_entry(&prefs, struct __prelim_ref, list); | 900 | ref = list_first_entry(&prefs, struct __prelim_ref, list); |
892 | list_del(&ref->list); | 901 | list_del(&ref->list); |
893 | if (ref->count < 0) | 902 | WARN_ON(ref->count < 0); |
894 | WARN_ON(1); | ||
895 | if (ref->count && ref->root_id && ref->parent == 0) { | 903 | if (ref->count && ref->root_id && ref->parent == 0) { |
896 | /* no parent == root of tree */ | 904 | /* no parent == root of tree */ |
897 | ret = ulist_add(roots, ref->root_id, 0, GFP_NOFS); | 905 | ret = ulist_add(roots, ref->root_id, 0, GFP_NOFS); |