Skip to content

Commit

Permalink
Btrfs: fix casting error in scrub reada code
Browse files Browse the repository at this point in the history
The reada code from scrub was casting down a u64 to
an unsigned long so it could insert it into a radix tree.

What it really wanted to do was cast down the result of a shift, instead
of casting down the u64.  The bug resulted in trying to insert our
reada struct into the wrong place, which caused soft lockups and other
problems.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Mar 3, 2012
1 parent d3b0106 commit a175423
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/reada.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info,

spin_lock(&fs_info->reada_lock);
ret = radix_tree_insert(&dev->reada_zones,
(unsigned long)zone->end >> PAGE_CACHE_SHIFT,
(unsigned long)(zone->end >> PAGE_CACHE_SHIFT),
zone);
spin_unlock(&fs_info->reada_lock);

Expand Down

0 comments on commit a175423

Please sign in to comment.