From: Lou Langholtz - set_blocksize() already does those size checks. - test the set_blocksize() return value: it can fail if the requested blocksize is less that the hard sector size. drivers/block/ioctl.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/block/ioctl.c~block_ioctl-fix drivers/block/ioctl.c --- 25/drivers/block/ioctl.c~block_ioctl-fix 2003-07-12 22:24:05.000000000 -0700 +++ 25-akpm/drivers/block/ioctl.c 2003-07-12 22:24:05.000000000 -0700 @@ -166,13 +166,11 @@ int blkdev_ioctl(struct inode *inode, st return -EINVAL; if (get_user(n, (int *) arg)) return -EFAULT; - if (n > PAGE_SIZE || n < 512 || (n & (n - 1))) - return -EINVAL; if (bd_claim(bdev, &holder) < 0) return -EBUSY; - set_blocksize(bdev, n); + ret = set_blocksize(bdev, n); bd_release(bdev); - return 0; + return ret; case BLKPG: return blkpg_ioctl(bdev, (struct blkpg_ioctl_arg *) arg); case BLKRRPART: _