diff options
-rw-r--r-- | nbd/server.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nbd/server.c b/nbd/server.c index 83f21c5591..4776009a2d 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1638,6 +1638,9 @@ static coroutine_fn int nbd_handle_request(NBDClient *client, case NBD_CMD_TRIM: ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset, request->len); + if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) { + ret = blk_co_flush(exp->blk); + } return nbd_send_generic_reply(client, request->handle, ret, "discard failed", errp); |