Skip to content

Commit

Permalink
Staging: zram: round up the disk size provided by user
Browse files Browse the repository at this point in the history
Currently disksize_store() round down the disk size provided by user.
This is probably not what one would expect, so round up instead.

Signed-off-by: Jerome Marchand <[email protected]>
Acked-by: Jeff Moyer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jeromemarchand authored and gregkh committed Jan 21, 2011
1 parent 2b15287 commit f2da987
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/zram/zram_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <linux/device.h>
#include <linux/genhd.h>
#include <linux/mm.h>

#include "zram_drv.h"

Expand Down Expand Up @@ -65,7 +66,7 @@ static ssize_t disksize_store(struct device *dev,
if (ret)
return ret;

zram->disksize &= PAGE_MASK;
zram->disksize = PAGE_ALIGN(zram->disksize);
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);

return len;
Expand Down

0 comments on commit f2da987

Please sign in to comment.