brd: fix overflow in __brd_direct_access
The code in __brd_direct_access multiplies the pgoff variable by page size
and divides it by 512. It can cause overflow on 32-bit architectures. The
overflow happens if we create ramdisk larger than 4G and use it as a
sparse device.
This patch replaces multiplication and division with multiplication by the
number of sectors per page.
Reviewed-by: Dan Williams <[email protected]>
Signed-off-by: Mikulas Patocka <[email protected]>
Fixes: 1647b9b959c7 ("brd: add dax_operations support")
Cc: [email protected] # 4.12+
Signed-off-by: Jens Axboe <[email protected]>