From 3d92b849e59c9caa28a2207560fb3bd21da74003 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Sat, 29 Apr 2017 09:46:43 +0100 Subject: [PATCH] fio.h: zero old flag bits when setting new ioengine flags Fix a small bug in td_set_ioengine_flags() where it wouldn't zero old bits in td->flags before setting new flag bits. Signed-off-by: Sitsofe Wheeler --- fio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fio.h b/fio.h index 6b2b669d..e11a0390 100644 --- a/fio.h +++ b/fio.h @@ -596,7 +596,8 @@ static inline enum fio_ioengine_flags td_ioengine_flags(struct thread_data *td) static inline void td_set_ioengine_flags(struct thread_data *td) { - td->flags |= (td->io_ops->flags << TD_ENG_FLAG_SHIFT); + td->flags = (~(TD_ENG_FLAG_MASK << TD_ENG_FLAG_SHIFT) & td->flags) | + (td->io_ops->flags << TD_ENG_FLAG_SHIFT); } static inline bool td_ioengine_flagged(struct thread_data *td, -- 2.25.1