diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2014-12-08 19:55:57 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-01-20 07:22:15 -0800 |
commit | bfca9a6d4b1322ba36235e8a652f05a9668ef59b (patch) | |
tree | 863e7cad45616ddc8a5417919d696ced884ddd2e /fs/btrfs/raid56.c | |
parent | e1746e8381cd2af421f75557b5cae3604fc18b35 (diff) | |
download | linux-stable-bfca9a6d4b1322ba36235e8a652f05a9668ef59b.tar.gz linux-stable-bfca9a6d4b1322ba36235e8a652f05a9668ef59b.tar.bz2 linux-stable-bfca9a6d4b1322ba36235e8a652f05a9668ef59b.zip |
btrfs: Fix calculation of rbio->dbitmap's size calculation
Current code is trying to calculate rbio->dbitmap's size to make it
align to sizeof(long), but implement haven't achived this object,
it is align to sizeof(char) instead.
This patch fixed above calculation, and use sizeof(long) instead of
fixed "8" to increate compatibility.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r-- | fs/btrfs/raid56.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 6d707545f775..9ee11b41ba5d 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -966,8 +966,8 @@ static struct btrfs_raid_bio *alloc_rbio(struct btrfs_root *root, void *p; rbio = kzalloc(sizeof(*rbio) + num_pages * sizeof(struct page *) * 2 + - DIV_ROUND_UP(stripe_npages, BITS_PER_LONG / 8), - GFP_NOFS); + DIV_ROUND_UP(stripe_npages, BITS_PER_LONG) * + sizeof(long), GFP_NOFS); if (!rbio) return ERR_PTR(-ENOMEM); |