From e202d3b8673de496fb3b2b0063a3f3296a990e12 Mon Sep 17 00:00:00 2001 From: youzhongyang Date: Fri, 31 Mar 2023 12:46:22 -0400 Subject: [PATCH] linux 6.3 compat: needs REQ_PREFLUSH | REQ_OP_WRITE Modify bio_set_flush() so if kernel version is >= 4.10, flags REQ_PREFLUSH and REQ_OP_WRITE are set together. Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Youzhong Yang Closes #14695 --- include/os/linux/kernel/linux/blkdev_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h index 11ecfd8caa..02a269a89f 100644 --- a/include/os/linux/kernel/linux/blkdev_compat.h +++ b/include/os/linux/kernel/linux/blkdev_compat.h @@ -415,7 +415,7 @@ static inline void bio_set_flush(struct bio *bio) { #if defined(HAVE_REQ_PREFLUSH) /* >= 4.10 */ - bio_set_op_attrs(bio, 0, REQ_PREFLUSH); + bio_set_op_attrs(bio, 0, REQ_PREFLUSH | REQ_OP_WRITE); #elif defined(WRITE_FLUSH_FUA) /* >= 2.6.37 and <= 4.9 */ bio_set_op_attrs(bio, 0, WRITE_FLUSH_FUA); #else