From: Robert Altnoeder Date: Fri, 13 Jan 2023 12:35:32 +0000 (+0100) Subject: drbd: fix DRBD_VOLUME_MAX 65535 -> 65534 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2167879655b3a9a0a970d50b202e45f7fc45d092;p=linux.git drbd: fix DRBD_VOLUME_MAX 65535 -> 65534 The protocol uses -1 as a reserved value for 'no specific volume', and since the protocol field is a 16 bit unsigned value, -1 is converted to 65535. Therefore, limit the range of valid volume numbers to [0, 65534]. Signed-off-by: Robert Altnoeder Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge Link: https://lore.kernel.org/r/20230113123538.144276-3-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe --- diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index d64271ccece42..058f7600f79c7 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h @@ -21,7 +21,7 @@ #define DRBD_MINOR_COUNT_DEF 32 #define DRBD_MINOR_COUNT_SCALE '1' -#define DRBD_VOLUME_MAX 65535 +#define DRBD_VOLUME_MAX 65534 #define DRBD_DIALOG_REFRESH_MIN 0 #define DRBD_DIALOG_REFRESH_MAX 600