diff options
author | Filipe Manana | 2014-04-24 09:15:29 -0500 |
---|---|---|
committer | Chris Mason | 2014-04-24 18:43:33 -0500 |
commit | f8213bdc89719bad895a02c62c4a85066ff76720 (patch) | |
tree | bae57bba7903618c8831d860474fb6052bb90310 /fs | |
parent | 9ce49a0b4ff7f13961d8d106ffae959823d2e758 (diff) | |
download | linux-phy-f8213bdc89719bad895a02c62c4a85066ff76720.tar.gz linux-phy-f8213bdc89719bad895a02c62c4a85066ff76720.tar.xz linux-phy-f8213bdc89719bad895a02c62c4a85066ff76720.zip |
Btrfs: correctly set profile flags on seqlock retry
If we had to retry on the profiles seqlock (due to a concurrent write), we
would set bits on the input flags that corresponded both to the current
profile and to previous values of the profile.
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 678cb352902c..5590af92094b 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3543,11 +3543,13 @@ static u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) | |||
3543 | return extended_to_chunk(flags | tmp); | 3543 | return extended_to_chunk(flags | tmp); |
3544 | } | 3544 | } |
3545 | 3545 | ||
3546 | static u64 get_alloc_profile(struct btrfs_root *root, u64 flags) | 3546 | static u64 get_alloc_profile(struct btrfs_root *root, u64 orig_flags) |
3547 | { | 3547 | { |
3548 | unsigned seq; | 3548 | unsigned seq; |
3549 | u64 flags; | ||
3549 | 3550 | ||
3550 | do { | 3551 | do { |
3552 | flags = orig_flags; | ||
3551 | seq = read_seqbegin(&root->fs_info->profiles_lock); | 3553 | seq = read_seqbegin(&root->fs_info->profiles_lock); |
3552 | 3554 | ||
3553 | if (flags & BTRFS_BLOCK_GROUP_DATA) | 3555 | if (flags & BTRFS_BLOCK_GROUP_DATA) |