Skip to content

Commit

Permalink
Staging: ramzswap: Set block size to PAGE_SIZE
Browse files Browse the repository at this point in the history
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: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Nitin Gupta authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 7eef753 commit 5d83d5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/staging/ramzswap/ramzswap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,10 @@ static int create_device(struct ramzswap *rzs, int device_id)
* or set equal to backing swap device (if provided)
*/
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);

rzs->init_done = 0;
Expand Down

0 comments on commit 5d83d5a

Please sign in to comment.