Skip to content

Commit 39722a2

Browse files
Christoph Hellwigaxboe
Christoph Hellwig
authored andcommitted
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 <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 99800ce commit 39722a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-lib.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
287287
if (bdev_write_zeroes_sectors(bdev)) {
288288
ret = blkdev_issue_write_zeroes(bdev, sector, nr_sects,
289289
gfp_mask, flags);
290-
if (!ret)
290+
if (ret != -EOPNOTSUPP)
291291
return ret;
292292
}
293293

0 commit comments

Comments
 (0)