Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <robert.altnoeder@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Reviewed-by: Joel Colledge <joel.colledge@linbit.com>
Link: https://lore.kernel.org/r/20230113123538.144276-3-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Robert Altnoeder and committed by
Jens Axboe
21678796 37800068

+1 -1
+1 -1
include/linux/drbd_limits.h
··· 21 21 #define DRBD_MINOR_COUNT_DEF 32 22 22 #define DRBD_MINOR_COUNT_SCALE '1' 23 23 24 - #define DRBD_VOLUME_MAX 65535 24 + #define DRBD_VOLUME_MAX 65534 25 25 26 26 #define DRBD_DIALOG_REFRESH_MIN 0 27 27 #define DRBD_DIALOG_REFRESH_MAX 600