iomap: use an unsigned type for IOMAP_DIO_* defines xfs-async-dio.5 xfs-async-dio
authorJens Axboe <axboe@kernel.dk>
Fri, 21 Jul 2023 16:03:25 +0000 (10:03 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Jul 2023 16:34:42 +0000 (10:34 -0600)
IOMAP_DIO_DIRTY shifts by 31 bits, which makes UBSAN unhappy. Clean up
all the defines by making the shifted value an unsigned value.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reported-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/iomap/direct-io.c

index 5c7ebe7d7d0b1124d98100ecc2b45e3f4d9b8fb1..29548a099bb0e089158d82ff5c81ecf3d4ddd716 100644 (file)
  * Private flags for iomap_dio, must not overlap with the public ones in
  * iomap.h:
  */
-#define IOMAP_DIO_CALLER_COMP  (1 << 26)
-#define IOMAP_DIO_INLINE_COMP  (1 << 27)
-#define IOMAP_DIO_WRITE_THROUGH        (1 << 28)
-#define IOMAP_DIO_NEED_SYNC    (1 << 29)
-#define IOMAP_DIO_WRITE                (1 << 30)
-#define IOMAP_DIO_DIRTY                (1 << 31)
+#define IOMAP_DIO_CALLER_COMP  (1U << 26)
+#define IOMAP_DIO_INLINE_COMP  (1U << 27)
+#define IOMAP_DIO_WRITE_THROUGH        (1U << 28)
+#define IOMAP_DIO_NEED_SYNC    (1U << 29)
+#define IOMAP_DIO_WRITE                (1U << 30)
+#define IOMAP_DIO_DIRTY                (1U << 31)
 
 struct iomap_dio {
        struct kiocb            *iocb;