diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-12-08 16:43:10 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-08 16:43:10 -0500 |
commit | 934d375bacf9ea8a37fbfff5f3cf1c093f324095 (patch) | |
tree | e81948e6e26028fd979ce59f4fc5988c1813694c /fs/btrfs/extent_io.c | |
parent | a512bbf855ff0af474257475f2e6da7acd854f52 (diff) |
Btrfs: Use map_private_extent_buffer during generic_bin_search
It is possible that generic_bin_search will be called on a tree block
that has not been locked. This happens because cache_block_block skips
locking on the tree blocks.
Since the tree block isn't locked, we aren't allowed to change
the extent_buffer->map_token field. Using map_private_extent_buffer
avoids any changes to the internal extent buffer fields.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7449ecf32c50..607f5ff2791c 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -3471,6 +3471,7 @@ int map_extent_buffer(struct extent_buffer *eb, unsigned long start, | |||
3471 | unmap_extent_buffer(eb, eb->map_token, km); | 3471 | unmap_extent_buffer(eb, eb->map_token, km); |
3472 | eb->map_token = NULL; | 3472 | eb->map_token = NULL; |
3473 | save = 1; | 3473 | save = 1; |
3474 | WARN_ON(!mutex_is_locked(&eb->mutex)); | ||
3474 | } | 3475 | } |
3475 | err = map_private_extent_buffer(eb, start, min_len, token, map, | 3476 | err = map_private_extent_buffer(eb, start, min_len, token, map, |
3476 | map_start, map_len, km); | 3477 | map_start, map_len, km); |