Serialize move/resize/set-sparse against in-progress conversions (#41170)
* Serialize move/resize/set-sparse against in-progress conversions MoveDistribution, SetSparse, and ResizeDistribution mutate a distribution's VHD but never checked m_lockedDistributions. A conversion (--set-version) or export releases m_instanceLock while running yet keeps the distribution in m_lockedDistributions, so these operations could start mid-conversion and race on the same VHD (e.g. a corrupt export, or the VHD moved/resized out from under a conversion). Add _EnsureNotLocked under m_instanceLock to each so they fail with E_ILLEGAL_STATE_CHANGE while a conversion/export/compaction is in progress, matching how the conversion paths already guard each other via _ConversionBegin. Add a regression test that holds a distribution in the Exporting state (via a blocked export pipe) and verifies --resize, --set-sparse, and --move are all rejected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 37ad1fd7-a452-4056-a8cc-e91cf7870a60 * Generalize lock-guard comments to conversion/export Compaction isn't part of this branch, so drop it from the comments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 37ad1fd7-a452-4056-a8cc-e91cf7870a60 * Address review: deterministic pipe block and accurate cleanup comment - Use an explicit 1-byte pipe buffer so the export blocks immediately regardless of test distro size, instead of relying on the default buffer filling. - Fix the cleanup comment: closing the read end unblocks the export via a broken pipe, it does not drain it to completion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 37ad1fd7-a452-4056-a8cc-e91cf7870a60 --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 37ad1fd7-a452-4056-a8cc-e91cf7870a60