Skip to content

Commit

Permalink
Btrfs: correctly set profile flags on seqlock retry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Filipe Manana authored and Chris Mason committed Apr 24, 2014
1 parent 9ce49a0 commit f8213bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f8213bd

Please sign in to comment.