diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-10-23 08:21:05 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-10-24 06:36:39 -0400 |
commit | d638108484d186bf97a838d037f165d9b404e6ee (patch) | |
tree | 4fb20d045666fc7228fe8a149172eec07595b240 /fs | |
parent | 5b6602e762cae17c8891d19698afea451e9c1d95 (diff) |
Btrfs: fix extent buffer reference for tree mod log roots
In get_old_root we grab a lock on the extent buffer before we obtain a
reference on that buffer. That order is changed now.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index ef68c33eefd9..f6739903d072 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1279,6 +1279,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) | |||
1279 | 1279 | ||
1280 | if (!eb) | 1280 | if (!eb) |
1281 | return NULL; | 1281 | return NULL; |
1282 | extent_buffer_get(eb); | ||
1282 | btrfs_tree_read_lock(eb); | 1283 | btrfs_tree_read_lock(eb); |
1283 | if (old_root) { | 1284 | if (old_root) { |
1284 | btrfs_set_header_bytenr(eb, eb->start); | 1285 | btrfs_set_header_bytenr(eb, eb->start); |
@@ -1291,7 +1292,6 @@ get_old_root(struct btrfs_root *root, u64 time_seq) | |||
1291 | __tree_mod_log_rewind(eb, time_seq, tm); | 1292 | __tree_mod_log_rewind(eb, time_seq, tm); |
1292 | else | 1293 | else |
1293 | WARN_ON(btrfs_header_level(eb) != 0); | 1294 | WARN_ON(btrfs_header_level(eb) != 0); |
1294 | extent_buffer_get(eb); | ||
1295 | WARN_ON(btrfs_header_nritems(eb) > BTRFS_NODEPTRS_PER_BLOCK(root)); | 1295 | WARN_ON(btrfs_header_nritems(eb) > BTRFS_NODEPTRS_PER_BLOCK(root)); |
1296 | 1296 | ||
1297 | return eb; | 1297 | return eb; |