diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-02-26 08:39:26 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-02-26 08:41:15 +0100 |
| commit | 3f7df3efeb415610d27aecc282ff96d4a22f0168 (patch) | |
| tree | 0f66382746a1311043a25320243ff5f4b10c282e /fs/btrfs/backref.c | |
| parent | x86/mm: Optimize boot-time paging mode switching cost (diff) | |
| parent | Linux 4.16-rc3 (diff) | |
| download | linux-3f7df3efeb415610d27aecc282ff96d4a22f0168.tar.gz linux-3f7df3efeb415610d27aecc282ff96d4a22f0168.zip | |
Merge tag 'v4.16-rc3' into x86/mm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/btrfs/backref.c')
| -rw-r--r-- | fs/btrfs/backref.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index e4054e533f6d..f94b2d8c744a 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1264,7 +1264,16 @@ again: while (node) { ref = rb_entry(node, struct prelim_ref, rbnode); node = rb_next(&ref->rbnode); - WARN_ON(ref->count < 0); + /* + * ref->count < 0 can happen here if there are delayed + * refs with a node->action of BTRFS_DROP_DELAYED_REF. + * prelim_ref_insert() relies on this when merging + * identical refs to keep the overall count correct. + * prelim_ref_insert() will merge only those refs + * which compare identically. Any refs having + * e.g. different offsets would not be merged, + * and would retain their original ref->count < 0. + */ if (roots && ref->count && ref->root_id && ref->parent == 0) { if (sc && sc->root_objectid && ref->root_id != sc->root_objectid) { |
