block: remove a superflous check in blkpg_do_ioctl
authorChristoph Hellwig <hch@lst.de>
Tue, 24 Nov 2020 08:43:52 +0000 (09:43 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Dec 2020 21:53:39 +0000 (14:53 -0700)
sector_t is now always a u64, so this check is not needed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/ioctl.c

index 6b78518..0c09bb7 100644 (file)
@@ -35,15 +35,6 @@ static int blkpg_do_ioctl(struct block_device *bdev,
        start = p.start >> SECTOR_SHIFT;
        length = p.length >> SECTOR_SHIFT;
 
-       /* check for fit in a hd_struct */
-       if (sizeof(sector_t) < sizeof(long long)) {
-               long pstart = start, plength = length;
-
-               if (pstart != start || plength != length || pstart < 0 ||
-                   plength < 0 || p.pno > 65535)
-                       return -EINVAL;
-       }
-
        switch (op) {
        case BLKPG_ADD_PARTITION:
                /* check if partition is aligned to blocksize */