diff options
author | Christoph Hellwig <hch@lst.de> | 2024-07-01 18:51:19 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-07-05 08:53:15 +0200 |
commit | 39722a2f2bcd82bdecc226711412d88b54fcb05b (patch) | |
tree | b6c9e3b6d69a44599fe33a509e2ffe9189c0015b /block | |
parent | block: refacto blkdev_issue_zeroout (diff) | |
download | linux-39722a2f2bcd82bdecc226711412d88b54fcb05b.tar.xz linux-39722a2f2bcd82bdecc226711412d88b54fcb05b.zip |
block: limit the Write Zeroes to manually writing zeroes fallback
Only fall back from hardware Write Zeroes failures when
blkdev_issue_write_zeroes returns -EOPNOTSUPP;
Note that blkdev_issue_write_zeroes turns any failure into -EOPNOTSUPP
when the write zeroes queue limit has been cleared to 0, so this still
catches all I/O errors where the driver detected missing support
for the hardware acceleration.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240701165219.1571322-10-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-lib.c b/block/blk-lib.c index 9dbab472c63f..2384acd913d2 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -287,7 +287,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, if (bdev_write_zeroes_sectors(bdev)) { ret = blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp_mask, flags); - if (!ret) + if (ret != -EOPNOTSUPP) return ret; } |