fio.h: zero old flag bits when setting new ioengine flags
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 29 Apr 2017 08:46:43 +0000 (09:46 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 29 Apr 2017 08:51:13 +0000 (09:51 +0100)
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 <sitsofe@yahoo.com>
fio.h

diff --git a/fio.h b/fio.h
index 6b2b669d3ccc93ac4aafadb8b59da91c537d6102..e11a03902676285635ae5d2e2dc2b60ed83eb401 100644 (file)
--- 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,