aboutsummaryrefslogtreecommitdiff
path: root/nbd/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'nbd/server.c')
-rw-r--r--nbd/server.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 91471f17a7..7063edbce2 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1038,6 +1038,7 @@ static void nbd_trip(void *opaque)
struct nbd_reply reply;
ssize_t ret;
uint32_t command;
+ int flags;
TRACE("Reading request.");
if (client->closing) {
@@ -1114,23 +1115,18 @@ static void nbd_trip(void *opaque)
TRACE("Writing to device");
+ flags = 0;
+ if (request.type & NBD_CMD_FLAG_FUA) {
+ flags |= BDRV_REQ_FUA;
+ }
ret = blk_pwrite(exp->blk, request.from + exp->dev_offset,
- req->data, request.len, 0);
+ req->data, request.len, flags);
if (ret < 0) {
LOG("writing to file failed");
reply.error = -ret;
goto error_reply;
}
- if (request.type & NBD_CMD_FLAG_FUA) {
- ret = blk_co_flush(exp->blk);
- if (ret < 0) {
- LOG("flush failed");
- reply.error = -ret;
- goto error_reply;
- }
- }
-
if (nbd_co_send_reply(req, &reply, 0) < 0) {
goto out;
}