coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.78k stars 172 forks source link

nbd: handle NBD_SET_FLAGS error due to old kernel version #324

Closed nak3 closed 7 years ago

nak3 commented 8 years ago

fixes https://github.com/coreos/torus/issues/295

nak3 commented 8 years ago

Old kernel doesn't support setting NBD_FLAG_SEND_TRIM and NBD_CMD_FLUSH by NBD_SET_FLAGS. This patch will output following error message instead of stop running process with retuning error.

2016-09-17 04:20:48.979478 E | nbd: ioctl returned: inappropriate ioctl for device. kernel version update is strongly recommended.
barakmich commented 8 years ago

A more robust option is to gracefully degrade. Turn off the unsupported flags; we can continue without receiving TRIM for sure, and if CMD_FLUSH never gets sent, we can emulate it by syncing every nominal interval in the degraded case.

nak3 commented 8 years ago

Alright. I will try. Thank you for your suggestion. (I should have read your comment on https://github.com/coreos/torus/issues/295)

nak3 commented 8 years ago

Updated. It might be too straightforward. Any suggestion is welcome.