Skip to content

Commit

Permalink
block: remove a superflous check in blkpg_do_ioctl
Browse files Browse the repository at this point in the history
sector_t is now always a u64, so this check is not needed.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Dec 1, 2020
1 parent b601d14 commit 3f50b95
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions block/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3f50b95

Please sign in to comment.