Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262235
b: refs/heads/master
c: 61cfea9
h: refs/heads/master
i:
  262233: 50e4d6b
  262231: ba84089
v: v3
  • Loading branch information
WuBo authored and Chris Mason committed Aug 1, 2011
1 parent 06f1e86 commit 6cef01e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 1bf85046e493c88be1c1bad9084428373089f618
refs/heads/master: 61cfea9bb84d41b09e59822c33b3eb27acc48358
10 changes: 7 additions & 3 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6549,8 +6549,6 @@ static int set_block_group_ro(struct btrfs_block_group_cache *cache, int force)
u64 min_allocable_bytes;
int ret = -ENOSPC;

if (cache->ro)
return 0;

/*
* We need some metadata space and system metadata space for
Expand All @@ -6566,6 +6564,12 @@ static int set_block_group_ro(struct btrfs_block_group_cache *cache, int force)

spin_lock(&sinfo->lock);
spin_lock(&cache->lock);

if (cache->ro) {
ret = 0;
goto out;
}

num_bytes = cache->key.offset - cache->reserved - cache->pinned -
cache->bytes_super - btrfs_block_group_used(&cache->item);

Expand All @@ -6579,7 +6583,7 @@ static int set_block_group_ro(struct btrfs_block_group_cache *cache, int force)
cache->ro = 1;
ret = 0;
}

out:
spin_unlock(&cache->lock);
spin_unlock(&sinfo->lock);
return ret;
Expand Down

0 comments on commit 6cef01e

Please sign in to comment.