diff options
-rw-r--r-- | fs/btrfs/extent-tree.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9a325e465ad9..5c9ef3ac25e1 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -242,6 +242,12 @@ get_caching_control(struct btrfs_block_group_cache *cache) | |||
242 | return NULL; | 242 | return NULL; |
243 | } | 243 | } |
244 | 244 | ||
245 | /* We're loading it the fast way, so we don't have a caching_ctl. */ | ||
246 | if (!cache->caching_ctl) { | ||
247 | spin_unlock(&cache->lock); | ||
248 | return NULL; | ||
249 | } | ||
250 | |||
245 | ctl = cache->caching_ctl; | 251 | ctl = cache->caching_ctl; |
246 | atomic_inc(&ctl->count); | 252 | atomic_inc(&ctl->count); |
247 | spin_unlock(&cache->lock); | 253 | spin_unlock(&cache->lock); |