aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Li <faithilikerun@gmail.com>2023-08-25 12:05:56 +0800
committerHanna Czenczek <hreitz@redhat.com>2023-11-06 16:15:07 +0100
commit10b9e0802a074c991e1ce485631d75641d0b0f9e (patch)
tree70f1451039be8204fd2c34b1fbc93bf09b73b372
parentb2b109041ecd1095384f5be5bb9badd13c1cf286 (diff)
block/file-posix: fix update_zones_wp() caller
When the zoned request fail, it needs to update only the wp of the target zones for not disrupting the in-flight writes on these other zones. The wp is updated successfully after the request completes. Fixed the callers with right offset and nr_zones. Signed-off-by: Sam Li <faithilikerun@gmail.com> Message-Id: <20230825040556.4217-1-faithilikerun@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> [hreitz: Rebased and fixed comment spelling] Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
-rw-r--r--block/file-posix.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index 50e2b20d5c..3c0ce9c258 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2523,7 +2523,10 @@ out:
}
}
} else {
- update_zones_wp(bs, s->fd, 0, 1);
+ /*
+ * write and append write are not allowed to cross zone boundaries
+ */
+ update_zones_wp(bs, s->fd, offset, 1);
}
qemu_co_mutex_unlock(&wps->colock);
@@ -3470,7 +3473,7 @@ static int coroutine_fn raw_co_zone_mgmt(BlockDriverState *bs, BlockZoneOp op,
len >> BDRV_SECTOR_BITS);
ret = raw_thread_pool_submit(handle_aiocb_zone_mgmt, &acb);
if (ret != 0) {
- update_zones_wp(bs, s->fd, offset, i);
+ update_zones_wp(bs, s->fd, offset, nrz);
error_report("ioctl %s failed %d", op_name, ret);
return ret;
}