Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332577
b: refs/heads/master
c: b5bae26
h: refs/heads/master
i:
  332575: 4f9474a
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Oct 4, 2012
1 parent bc4c44d commit 0305138
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff44c6e36dc9dcc02652a1105b120bdf08cea9f7
refs/heads/master: b5bae2612af92fd8e7bcdcf7ce3e0259e8d341c9
23 changes: 19 additions & 4 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3256,19 +3256,34 @@ int btree_write_cache_pages(struct address_space *mapping,
break;
}

spin_lock(&mapping->private_lock);
if (!PagePrivate(page)) {
spin_unlock(&mapping->private_lock);
continue;
}

eb = (struct extent_buffer *)page->private;

/*
* Shouldn't happen and normally this would be a BUG_ON
* but no sense in crashing the users box for something
* we can survive anyway.
*/
if (!eb) {
spin_unlock(&mapping->private_lock);
WARN_ON(1);
continue;
}

if (eb == prev_eb)
if (eb == prev_eb) {
spin_unlock(&mapping->private_lock);
continue;
}

if (!atomic_inc_not_zero(&eb->refs)) {
WARN_ON(1);
ret = atomic_inc_not_zero(&eb->refs);
spin_unlock(&mapping->private_lock);
if (!ret)
continue;
}

prev_eb = eb;
ret = lock_extent_buffer_for_io(eb, fs_info, &epd);
Expand Down

0 comments on commit 0305138

Please sign in to comment.