提交 5d83d5a0 编写于 作者: N Nitin Gupta 提交者: Greg Kroah-Hartman

Staging: ramzswap: Set block size to PAGE_SIZE

ramzswap block size needs to be set equal to PAGE_SIZE to
avoid receiving any unaligned block I/O requests (happens
due to readahead logic during swapon). These unaligned
accesses produce unnecessary I/O errors, scaring users.
Signed-off-by: NNitin Gupta <ngupta@vflare.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7eef7533
...@@ -1335,6 +1335,10 @@ static int create_device(struct ramzswap *rzs, int device_id) ...@@ -1335,6 +1335,10 @@ static int create_device(struct ramzswap *rzs, int device_id)
* or set equal to backing swap device (if provided) * or set equal to backing swap device (if provided)
*/ */
set_capacity(rzs->disk, 0); set_capacity(rzs->disk, 0);
blk_queue_physical_block_size(rzs->disk->queue, PAGE_SIZE);
blk_queue_logical_block_size(rzs->disk->queue, PAGE_SIZE);
add_disk(rzs->disk); add_disk(rzs->disk);
rzs->init_done = 0; rzs->init_done = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册