Skip to content

Commit

Permalink
Btrfs: just free dummy extent buffers
Browse files Browse the repository at this point in the history
If we fail during our sanity tests we could get NULL deref's because we unload
the module before the dummy extent buffers are free'd via RCU.  So check for
this case and just free the things directly.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
  • Loading branch information
Josef Bacik committed Mar 17, 2015
1 parent ba11721 commit bcb7e44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/extent_io.c
Expand Up @@ -4968,6 +4968,12 @@ static int release_extent_buffer(struct extent_buffer *eb)

/* Should be safe to release our pages at this point */
btrfs_release_extent_buffer_page(eb);
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
if (unlikely(test_bit(EXTENT_BUFFER_DUMMY, &eb->bflags))) {
__free_extent_buffer(eb);
return 1;
}
#endif
call_rcu(&eb->rcu_head, btrfs_release_extent_buffer_rcu);
return 1;
}
Expand Down

0 comments on commit bcb7e44

Please sign in to comment.