--- a/block/ioctl.c +++ b/block/ioctl.c @@ -679,7 +679,7 @@ long compat_blkdev_ioctl(struct file *fi (bdev->bd_bdi->ra_pages * PAGE_SIZE) / 512); case BLKGETSIZE: size = i_size_read(bdev->bd_inode); - if ((size >> 9) > ~0UL) + if ((size >> 9) > ~(compat_ulong_t)0) return -EFBIG; return compat_put_ulong(argp, size >> 9);