summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@gmail.com>2014-04-24 15:15:29 +0100
committerChris Mason <clm@fb.com>2014-04-24 16:43:33 -0700
commitf8213bdc89719bad895a02c62c4a85066ff76720 (patch)
treebae57bba7903618c8831d860474fb6052bb90310 /fs/btrfs/extent-tree.c
parent9ce49a0b4ff7f13961d8d106ffae959823d2e758 (diff)
downloadop-kernel-dev-f8213bdc89719bad895a02c62c4a85066ff76720.zip
op-kernel-dev-f8213bdc89719bad895a02c62c4a85066ff76720.tar.gz
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/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 678cb35..5590af9 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)
return extended_to_chunk(flags | tmp);
}
-static u64 get_alloc_profile(struct btrfs_root *root, u64 flags)
+static u64 get_alloc_profile(struct btrfs_root *root, u64 orig_flags)
{
unsigned seq;
+ u64 flags;
do {
+ flags = orig_flags;
seq = read_seqbegin(&root->fs_info->profiles_lock);
if (flags & BTRFS_BLOCK_GROUP_DATA)
OpenPOWER on IntegriCloud