On 12/6/20 6:53 AM, Tom Yan wrote:
Mimicking blkdev_issue_flush(). Seems like a right thing to do, as
they are a bunch of REQ_OP_WRITE.
Signed-off-by: Tom Yan <tom.ty89@xxxxxxxxx>
---
block/blk-lib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/blk-lib.c b/block/blk-lib.c
index 354dcab760c7..5579fdea893d 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -422,6 +422,8 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
} else if (!(flags & BLKDEV_ZERO_NOFALLBACK)) {
ret = __blkdev_issue_zero_pages(bdev, sector, nr_sects,
gfp_mask, &bio);
+ if (bio)
+ bio->bi_opf |= REQ_PREFLUSH;
} else {
/* No zeroing offload support */
ret = -EOPNOTSUPP;
PREFLUSH is for the 'flush' machinery (cf blk-flush.c). Which is okay
for blkdev_issue_flush(), but certainly not for zeroout.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer