[PATCH nbd-client] client: Request NBD_INFO_BLOCK_SIZE and set constraints in the kernel
This is the smallest change needed to allow NBD servers to specify a
preferred block size, and reflect that in
/sys/devices/virtual/block/nbd0/queue/minimum_io_size /
/sys/devices/virtual/block/nbd0/queue/optimal_io_size.
Notes:
- Requires the associated kernel patch.
- We should probably remove the -b option, allowing the NBD server to
set this instead (via the minimum block size setting). However as
that is a major change, I did not do it here.
- Absolutely no checking is done that the preferred block size makes
sense. The server can send anything and it'll be reflected in
those files. Is this bad? Possibly. We should probably at least
sanity check the value (eg. is it a power of 2, is it in the range
block size .. 32M). Should we do other checks?
- I only bothered changing the netlink interface, not the ioctl
interface, as it is my understanding (maybe not correct?) that the
ioctl interface is deprecated.
Rich.
Reply to: