acozzette/BUSE

preprocessor issue under 3.11/gcc 4.8.1

asharp opened this issue · 1 comments

Hey,

Under 3.11 and gcc 4.8.1 it looks as though the #ifdef's around NBD_CMD_FLUSH and NBD_CMD_TRIM are somehow broken. When you attempt to mkfs your ndb device the client crashes on the assert(0) in the default case. Removing the #if defined's causes the client to work correctly (and if you leave them in, you'll notice that you'll get commands with NBD_CMD_FLUSH, etc. in the default clause).

To reproduce, compile then run mkfs.ext3 against your nbd device.

Thanks,

Thanks for the bug report! I looked into it and I don't think those ifdefs ever actually worked properly because NBD_CMD_FLUSH and NBD_CMD_TRIM are members of an enum and not actually macros. I replaced them with real macros so that it now works for me and should hopefully still work with old versions of NBD that don't support flush or trim. Feel free to reopen this issue if it still doesn't work for you.