block/rnbd: Set write-back cache and fua same to the target device
authorGioh Kim <gi-oh.kim@cloud.ionos.com>
Thu, 10 Dec 2020 10:18:24 +0000 (11:18 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Dec 2020 21:55:59 +0000 (14:55 -0700)
commit512c781fd28cb401ee9f2843e32bf4640732c671
treefa2cd61c8dc15148e43eb41d979f7546fb988f94
parent3877ece01e46f01fae0fbc00df93d0e5f23196b0
block/rnbd: Set write-back cache and fua same to the target device

The rnbd-client always sets the write-back cache and fua attributes
of the rnbd device queue regardless of the target device on the server.
That generates IO hang issue when the target device does not
support both of write-back cacne and fua.

This patch adds more fields for the cache policy and fua into the
device opening message. The rnbd-server sends the information
if the target device supports the write-back cache and fua
and rnbd-client recevives it and set the device queue accordingly.

Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
[jwang: some minor change, rename a few varables, remove unrelated comments.]
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-clt.c
drivers/block/rnbd/rnbd-clt.h
drivers/block/rnbd/rnbd-proto.h
drivers/block/rnbd/rnbd-srv.c