diff mbox series

[06/10] block: remove the LBA alignment check in __blkdev_issue_zeroout

Message ID 20240701165219.1571322-7-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/10] block: move secure erase checks into the ioctl handler | expand

Commit Message

Christoph Hellwig July 1, 2024, 4:51 p.m. UTC
__blkdev_issue_zeroout is a purely kernel internal API and thus can rely
on the block layer sector alignment checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-lib.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-lib.c b/block/blk-lib.c
index f338709aef0c30..7aa7937c34201d 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -209,11 +209,6 @@  int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
 		unsigned flags)
 {
 	int ret;
-	sector_t bs_mask;
-
-	bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1;
-	if ((sector | nr_sects) & bs_mask)
-		return -EINVAL;
 
 	ret = __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp_mask,
 			biop, flags);