Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
file-posix: Fix zone update in I/O error path
We must check that zone information is present before running
update_zones_wp().

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2234374
Fixes: Coverity CID 1512459
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230824155345.109765-4-hreitz@redhat.com>
Reviewed-by: Sam Li <faithilikerun@gmail.com>
  • Loading branch information
XanClic committed Aug 29, 2023
1 parent 4b5d80f commit deab5c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/file-posix.c
Expand Up @@ -2525,7 +2525,8 @@ static int coroutine_fn raw_co_prw(BlockDriverState *bs, uint64_t offset,
}
}
} else {
if (type & (QEMU_AIO_WRITE | QEMU_AIO_ZONE_APPEND)) {
if ((type & (QEMU_AIO_WRITE | QEMU_AIO_ZONE_APPEND)) &&
bs->bl.zoned != BLK_Z_NONE) {
update_zones_wp(bs, s->fd, 0, 1);
}
}
Expand Down

0 comments on commit deab5c9

Please sign in to comment.