NBD_CMD_FLAG_FUA is defined as 1<<0 in the documentation, but 1<<16 in nbd.h.
The code currently treats the command as a 32 bit quantity and masks this off. This is confusing. Until such time as the code is fixed up, make it obvious this isn't really bit 16. Signed-off-by: Alex Bligh <a...@alex.org.uk> --- nbd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nbd.h b/nbd.h index f2a32dd..732c605 100644 --- a/nbd.h +++ b/nbd.h @@ -38,7 +38,8 @@ enum { }; #define NBD_CMD_MASK_COMMAND 0x0000ffff -#define NBD_CMD_FLAG_FUA (1<<16) +#define NBD_CMD_SHIFT (16) +#define NBD_CMD_FLAG_FUA ((1 << 0) << NBD_CMD_SHIFT) /* values for flags field */ #define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */ -- 1.9.1