diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-04-27 12:41:46 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-04-27 13:55:14 -0400 |
commit | 1f699d38b6556c393ac80f1c23c2053502a51631 (patch) | |
tree | 9ba8e3c95cc044461eab17dfba50515535ca2a25 | |
parent | 1daf3540fa77faea2f91d96bcaf07ce48ee827be (diff) |
Btrfs: fix block_rsv and space_info lock ordering
may_commit_transaction() calls
spin_lock(&space_info->lock);
spin_lock(&delayed_rsv->lock);
and update_global_block_rsv() calls
spin_lock(&block_rsv->lock);
spin_lock(&sinfo->lock);
Lockdep complains about this at run time.
Everywhere except in update_global_block_rsv(), the space_info lock is
the outer lock, therefore the locking order in update_global_block_rsv()
is changed.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 84497f8eb043..6fc2e6f5aab8 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -4214,8 +4214,8 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info) | |||
4214 | 4214 | ||
4215 | num_bytes = calc_global_metadata_size(fs_info); | 4215 | num_bytes = calc_global_metadata_size(fs_info); |
4216 | 4216 | ||
4217 | spin_lock(&block_rsv->lock); | ||
4218 | spin_lock(&sinfo->lock); | 4217 | spin_lock(&sinfo->lock); |
4218 | spin_lock(&block_rsv->lock); | ||
4219 | 4219 | ||
4220 | block_rsv->size = num_bytes; | 4220 | block_rsv->size = num_bytes; |
4221 | 4221 | ||
@@ -4241,8 +4241,8 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info) | |||
4241 | block_rsv->full = 1; | 4241 | block_rsv->full = 1; |
4242 | } | 4242 | } |
4243 | 4243 | ||
4244 | spin_unlock(&sinfo->lock); | ||
4245 | spin_unlock(&block_rsv->lock); | 4244 | spin_unlock(&block_rsv->lock); |
4245 | spin_unlock(&sinfo->lock); | ||
4246 | } | 4246 | } |
4247 | 4247 | ||
4248 | static void init_global_block_rsv(struct btrfs_fs_info *fs_info) | 4248 | static void init_global_block_rsv(struct btrfs_fs_info *fs_info) |