qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] block/preallocate: fix image truncation logic
@ 2024-11-28 18:25 Denis V. Lunev via
  2024-11-28 18:25 ` [PATCH 1/6] preallocate: truncate the image inside bdrv_inactivate() Denis V. Lunev via
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Denis V. Lunev via @ 2024-11-28 18:25 UTC (permalink / raw)
  To: qemu-block, qemu-devel
  Cc: den, Vladimir Sementsov-Ogievskiy, Andrey Drobyshev, Kevin Wolf,
	Hanna Reitz

Recent QEMU changes around preallocate_set_perm mandates that it is not
possible to poll on aio_context inside this function anymore. Thus
truncate operation has been moved inside bottom half. This bottom half
is scheduled from preallocate_set_perm() and that is all.

This approach proven to be problematic in a lot of places once
additional operations are executed over preallocate filter in
production. The code validates that permissions have been really changed
just after the call to the set operation.

A lot of time has been spent since the previous series in order to
stabilize changes with a whole product regression. This is reflected
with some unit tests added. Without this series 2 out of 3 are broken.

In general, the approach has been changed. We should not have image
truncate inside permission handling routines. That would be quite
incorrect and wrong, f.e. we potentially have truncate() executed
once we returned from bdrv_inactivate() and the ownership of the image
does not belong to us anymore.

It should be noted that the life cycle of the image length is quite
similar to one of the CBT and thus places where CBT is handled should
provide a good hint. This is just a guideline note.

Thus the most noticeable change is an addition of preallocate_inactivate()
callback and cleanup of all asynchronous stuff.

Changes from v2:
- the series has been completely rethinked

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-28 18:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 18:25 [PATCH v3 0/6] block/preallocate: fix image truncation logic Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 1/6] preallocate: truncate the image inside bdrv_inactivate() Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 2/6] preallocate: do not enable filter inside preallocate_co_getlength() Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 3/6] preallocate: rework preallocate_truncate_to_real_size() Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 4/6] preallocate: remove bottom half from preallocate filter Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 5/6] preallocate: simplify preallocate_drop_resize Denis V. Lunev via
2024-11-28 18:25 ` [PATCH 6/6] iotests: add preallocate filter checks Denis V. Lunev via

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).